init commit
This commit is contained in:
commit
c9d982669a
461 changed files with 30317 additions and 0 deletions
34
resources/js/components/Breadcrumbs.svelte
Normal file
34
resources/js/components/Breadcrumbs.svelte
Normal file
|
@ -0,0 +1,34 @@
|
|||
<script lang="ts">
|
||||
import { Breadcrumb, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Item } from '@/components/ui/breadcrumb';
|
||||
import { Link } from '@inertiajs/svelte';
|
||||
|
||||
interface BreadcrumbItem {
|
||||
title: string;
|
||||
href?: string;
|
||||
}
|
||||
|
||||
interface Props {
|
||||
breadcrumbs: BreadcrumbItem[];
|
||||
}
|
||||
|
||||
let { breadcrumbs }: Props = $props();
|
||||
</script>
|
||||
|
||||
<Breadcrumb>
|
||||
<BreadcrumbList>
|
||||
{#each breadcrumbs as item, index (index)}
|
||||
<Item>
|
||||
{#if index === breadcrumbs.length - 1}
|
||||
<BreadcrumbPage>{item.title}</BreadcrumbPage>
|
||||
{:else}
|
||||
<BreadcrumbLink>
|
||||
<Link href={item.href ?? '#'}>{item.title}</Link>
|
||||
</BreadcrumbLink>
|
||||
{/if}
|
||||
</Item>
|
||||
{#if index !== breadcrumbs.length - 1}
|
||||
<BreadcrumbSeparator />
|
||||
{/if}
|
||||
{/each}
|
||||
</BreadcrumbList>
|
||||
</Breadcrumb>
|
Loading…
Add table
Add a link
Reference in a new issue