<script setup lang="ts">
import { SvgArrowRightIcon } from '@vben/icons';

import useAvatar from '@/assets/image/user.png';

import Logo from '#/assets/image/logo.png';
import { useLoginModalStore } from '#/store';

import SelectLang from '../select-lang.vue';
import Avatar from './avatar.vue';

const loginModalStore = useLoginModalStore();

const menus = [
  { title: 'Tool Downloads', path: '/' },
  { title: 'AI-generated Apps', path: '/' },
  { title: 'AI Assistants', path: '/' },
  { title: 'Shalu Academy', path: '/' },
  { title: 'Application Market', path: '/' },
];

function openLogin() {
  loginModalStore.open();
}
</script>

<template>
  <div class="mb-[32px] flex items-center justify-between">
    <img :src="Logo" alt="logo" class="logo" height="30px" width="138px" />
    <ul class="menu flex gap-[60px] text-xs">
      <li
        v-for="menuItem in menus"
        :key="menuItem.title"
        class="flex items-center gap-2"
      >
        <span>{{ menuItem.title }}</span>
        <SvgArrowRightIcon class="arrow size-2" />
      </li>
    </ul>
    <div class="flex gap-2">
      <SelectLang />
      <Avatar :avatar="useAvatar" class="cursor-pointer" @click="openLogin" />
    </div>
  </div>
</template>

<style lang="scss" scoped>
.logo {
  cursor: pointer;
}

.menu li {
  color: #462424;
  cursor: pointer;

  &:hover {
    color: #7a003d;

    :deep(path) {
      fill: #7a003d;
    }
  }
}
</style>
