feat: admin tabs
This commit is contained in:
@@ -12,6 +12,14 @@ const props = defineProps({
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
admin: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
hide: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
@@ -19,13 +27,21 @@ const route = useRoute()
|
||||
const active = computed(() => {
|
||||
return route.path === props.to
|
||||
})
|
||||
|
||||
const activeClass = computed(() => {
|
||||
return props.admin ? 'bg-amber-500 text-white' : 'bg-primary text-white'
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NuxtLink
|
||||
class="px-4 py-3 flex items-center gap-2 rounded-lg transition cursor-pointer"
|
||||
:class="active ? 'bg-primary text-white' : 'hover:bg-neutral-200'"
|
||||
:to="to"
|
||||
v-if="!hide"
|
||||
:class="{
|
||||
[activeClass]: active,
|
||||
'hover:bg-neutral-200': !active,
|
||||
}"
|
||||
:to="to"
|
||||
class="px-4 py-3 flex items-center gap-2 rounded-lg transition cursor-pointer"
|
||||
>
|
||||
<Icon :name="icon" class="text-xl inline"/>
|
||||
<h1 class="text-[14px] font-medium">{{ label }}</h1>
|
||||
|
||||
Reference in New Issue
Block a user