first commit
This commit is contained in:
commit
e687b4437b
418 files changed
+33577
No files matched your search
@@ -0,0 +1,49 @@
|
||||
<script lang="ts">
|
||||
import { Link } from '@inertiajs/svelte';
|
||||
import {
|
||||
SidebarGroup,
|
||||
SidebarGroupLabel,
|
||||
SidebarMenu,
|
||||
SidebarMenuButton,
|
||||
SidebarMenuItem,
|
||||
} from '@/components/ui/sidebar';
|
||||
import { currentUrlState } from '@/lib/currentUrl.svelte';
|
||||
import { toUrl } from '@/lib/utils';
|
||||
import type { NavItem } from '@/types';
|
||||
|
||||
let {
|
||||
items = [],
|
||||
}: {
|
||||
items: NavItem[];
|
||||
} = $props();
|
||||
|
||||
const url = currentUrlState();
|
||||
</script>
|
||||
|
||||
<SidebarGroup class="px-2 py-0">
|
||||
<SidebarGroupLabel>Platform</SidebarGroupLabel>
|
||||
<SidebarMenu>
|
||||
{#each items as item (toUrl(item.href))}
|
||||
<SidebarMenuItem>
|
||||
<SidebarMenuButton
|
||||
asChild
|
||||
isActive={url.isCurrentUrl(item.href, url.currentUrl)}
|
||||
tooltip={item.title}
|
||||
>
|
||||
{#snippet children(props)}
|
||||
<Link
|
||||
{...props}
|
||||
href={toUrl(item.href)}
|
||||
class={props.class}
|
||||
>
|
||||
{#if item.icon}
|
||||
<item.icon class="size-4 shrink-0" />
|
||||
{/if}
|
||||
<span>{item.title}</span>
|
||||
</Link>
|
||||
{/snippet}
|
||||
</SidebarMenuButton>
|
||||
</SidebarMenuItem>
|
||||
{/each}
|
||||
</SidebarMenu>
|
||||
</SidebarGroup>
|
||||
Reference in new issue
Block a user