<template>
  <!-- 左侧菜单 -->
  <div :class="{ 'has-logo': sidebarLogo }">
    <logo v-if="sidebarLogo" :collapse="!appStore.sidebar.opened" />
    <div class="myRouter">
      <div class="myRouter-item" @click="routerTo('/createVideo')">
        <div class="icon">
          <el-icon><i-ep-edit /></el-icon>
        </div>
        {{ $t("createVideo.title") }}
      </div>
      <div class="myRouter-item" @click="routerTo('/moveImg')">
        <div class="icon">
          <el-icon><i-ep-edit /></el-icon>
        </div>
        {{ $t("createVideo.title") }}123
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { RouteLocationRaw, useRoute, useRouter } from "vue-router";

import SidebarItem from "./SidebarItem.vue";
import Logo from "./Logo.vue";

import { useSettingsStore } from "@/store/modules/settings";
import { usePermissionStore } from "@/store/modules/permission";
import { useAppStore } from "@/store/modules/app";
import { storeToRefs } from "pinia";
import variables from "@/styles/variables.module.scss";

// 静态路由
import { constantRoutes } from "@/router";
const settingsStore = useSettingsStore();
const permissionStore = usePermissionStore();
const appStore = useAppStore();

const { sidebarLogo } = storeToRefs(settingsStore);
const route = useRoute();
const router = useRouter();

function routerTo(url: RouteLocationRaw) {
  router.push(url);
}
</script>

<style lang="scss" scoped>
.myRouter {
  position: relative;
  height: calc(100% - 80px);
  padding: 200px 20px 0;
  color: #fff;
  // color: #868593;

  &-item {
    display: flex;
    width: 100%;
    height: 50px;
    padding-left: 10px;
    font-size: 20px;
    font-weight: 500;
    line-height: 50px;
    text-align: center;
    cursor: pointer;
    // border-bottom: 2px solid #fff;
    transition: all 0.3s;
    border-radius: 5px;
    margin-bottom: 20px;
    margin-right: 20px;

    .icon {
      width: 40px;
      height: 40px;
      color: #fff;
      border-radius: 50%;

      .el-icon {
        width: 25px;
        height: 25px;
        font-size: 25px;
        // color: #797a9f;
        color: #fff;
        text-align: center;
        vertical-align: sub;
      }
    }

    &:hover {
      // background: rgba(255, 255, 255, 0.2);
      color: #000;
      background: #fff;
      .el-icon {
        // color: #d4d0ff;
        color: #000;
      }
    }
  }

  .pricing {
    position: absolute;
    bottom: 60px;
    width: calc(100% - 40px);
    text-align: center;
  }
  .API {
    position: absolute;
    bottom: 0px;
    width: calc(100% - 40px);
    text-align: center;
  }
}

:deep(.el-sub-menu__title) {
  // background-color: #000 !important;
}

:deep(.el-menu-item) {
  div {
    // background-color: #000 !important;
  }

  // background-color: #000 !important;
}

:deep(.el-menu-item.is-active) {
  color: #fff;
}
</style>
