<script setup lang="ts">
import { useAuthStore } from '~/stores/login';
import type { AuthorizationMenuType } from '~/types/login';
import { LogoutOutlined } from '@ant-design/icons-vue';
const router = useRouter();
const authStore = useAuthStore();
const logout = async () => {
  await authStore.unauthorized();
  message.info('로그아웃되었습니다.');
};

defineProps<{
  menuList: AuthorizationMenuType[];
}>();

const movePage = () => {
  router.push('/admin/personal/info');
};
</script>

<template>
  <a-row justify="end" class="d-flex align-center pr-4" style="height: 100%">
    <a-col>
      <a-button type="primary" @click="movePage" class="mr-5">
        개인정보관리
      </a-button>
    </a-col>

    <a-col>
      <a-button @click="logout">
        <template #icon>
          <LogoutOutlined />
        </template>
        로그아웃
      </a-button>
    </a-col>
  </a-row>
</template>
