44 lines
1.0 KiB
Vue
44 lines
1.0 KiB
Vue
<template>
|
|||
|
|
<header class="dhome-topbar">
|
||
|
|
<div>
|
||
|
|
<p class="dhome-topbar__eyebrow">نمای کلی</p>
|
||
|
|
<h1 class="dhome-topbar__title">{{ userStore.userInfo?.name ?? 'کاربر' }}</h1>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="dhome-topbar__actions">
|
||
|
|
<button type="button" class="dhome-btn-ghost" @click="router.push({ name: 'user' })">
|
||
|
|
<BasicIcon icon="vuesax-linear:user" size="16" />
|
||
|
|
<span>حساب کاربری</span>
|
||
|
|
</button>
|
||
|
|
<button
|
||
|
|
v-if="showLogout"
|
||
|
|
type="button"
|
||
|
|
class="dhome-btn-ghost"
|
||
|
|
@click="$emit('logout')"
|
||
|
|
>
|
||
|
|
<BasicIcon icon="vuesax-linear:logout" size="16" />
|
||
|
|
<span>خروج</span>
|
||
|
|
</button>
|
||
|
|
</div>
|
||
|
|
</header>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script lang="ts" setup>
|
||
|
|
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
|
||
|
|
import { useUserStore } from '@/store/userStore'
|
||
|
|
import router from '@/router'
|
||
|
|
|
||
|
|
withDefaults(
|
||
|
|
defineProps<{
|
||
|
|
showLogout?: boolean
|
||
|
|
}>(),
|
||
|
|
{ showLogout: true },
|
||
|
|
)
|
||
|
|
|
||
|
|
defineEmits<{
|
||
|
|
logout: []
|
||
|
|
}>()
|
||
|
|
|
||
|
|
const userStore = useUserStore()
|
||
|
|
</script>
|