90 lines
2.0 KiB
Vue
90 lines
2.0 KiB
Vue
<script setup lang="ts">
|
|
const navMenu: any[] = [
|
|
{
|
|
heading: 'General',
|
|
items: [
|
|
{
|
|
title: 'Home',
|
|
icon: 'i-lucide-home',
|
|
link: '/',
|
|
},
|
|
],
|
|
},
|
|
]
|
|
|
|
const navMenuBottom: any[] = [
|
|
{
|
|
title: 'Help & Support',
|
|
icon: 'i-lucide-circle-help',
|
|
link: 'https://github.com/simrs/simrs-fe',
|
|
},
|
|
]
|
|
|
|
function resolveNavItemComponent(item: any): any {
|
|
if ('children' in item) return resolveComponent('LayoutSidebarNavGroup')
|
|
|
|
return resolveComponent('LayoutSidebarNavLink')
|
|
}
|
|
|
|
const teams: {
|
|
name: string
|
|
logo: string
|
|
plan: string
|
|
}[] = [
|
|
{
|
|
name: 'SIMRS - RSSA',
|
|
logo: 'i-lucide-gallery-vertical-end',
|
|
plan: 'Saiful Anwar Hospital',
|
|
},
|
|
]
|
|
|
|
const user: {
|
|
name: string
|
|
email: string
|
|
avatar: string
|
|
} = {
|
|
name: 'John Doe',
|
|
email: 'john.doe@email.com',
|
|
avatar: '/avatars/avatartion.png',
|
|
}
|
|
|
|
// const { sidebar } = useAppSettings()
|
|
const sidebar = {
|
|
collapsible: 'offcanvas', // 'offcanvas' | 'icon' | 'none'
|
|
side: 'left', // 'left' | 'right'
|
|
variant: 'sidebar', // 'sidebar' | 'floating' | 'inset'
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<Sidebar :collapsible="sidebar.collapsible" :side="sidebar.side" :variant="sidebar.variant">
|
|
<SidebarHeader>
|
|
<LayoutSidebarNavHeader :teams="teams" />
|
|
<Search />
|
|
</SidebarHeader>
|
|
<SidebarContent>
|
|
<SidebarGroup v-for="(nav, indexGroup) in navMenu" :key="indexGroup">
|
|
<SidebarGroupLabel v-if="nav.heading">
|
|
{{ nav.heading }}
|
|
</SidebarGroupLabel>
|
|
<component :is="resolveNavItemComponent(item)" v-for="(item, index) in nav.items" :key="index" :item="item" />
|
|
</SidebarGroup>
|
|
<SidebarGroup class="mt-auto">
|
|
<component
|
|
:is="resolveNavItemComponent(item)"
|
|
v-for="(item, index) in navMenuBottom"
|
|
:key="index"
|
|
:item="item"
|
|
size="sm"
|
|
/>
|
|
</SidebarGroup>
|
|
</SidebarContent>
|
|
<SidebarFooter>
|
|
<LayoutSidebarNavFooter :user="user" />
|
|
</SidebarFooter>
|
|
<SidebarRail />
|
|
</Sidebar>
|
|
</template>
|
|
|
|
<style scoped></style>
|