<script setup>
import { storeToRefs } from 'pinia';
import { useAppStore } from '@/stores/modules/appStore';

import SvgIcon from '@/components/SvgIcon';
import BasePopover from "@/components/BasePopover"

const appStore = useAppStore();
const { subMenuCollapse } = storeToRefs(appStore);

const changeCollapse = () => appStore.toggleSubMenuCollapse();
</script>

<template>
  <div class="logo-main flex items-center justify-between py-[14px] px-[20px]">
    <div class="title flex items-center space-x-2">
      <div class="w-[28px] h-[28px]">
        <SvgIcon name="common-logo" size="28"></SvgIcon>
      </div>
      <span class="block w-[70px] font-[10px] text-center">人工智能运营体智慧决策助手</span>
    </div>
    <!-- 图标 -->
    <div class="icon-group flex items-center justify-center"  @click="changeCollapse" v-show="!subMenuCollapse">
      <BasePopover placement="right" content="历史记录">
        <SvgIcon class="cursor-pointer" name="tool-arrow-history" size="20"></SvgIcon>
      </BasePopover>
    </div>
  </div>
</template>

<style scoped lang="scss">
.logo-main {
  font-family: AlimamaShuHeiTi;

  .title {
    font-size: 10px;
    line-height: 12px;
  }

  .icon-group {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    color: #4F5866;
    &:hover {
      color: #2454FF;
      background: #fff;
    }
  }
}
</style>