Files
salam e687b4437b
linter / quality (push) Canceled after 0s
tests / ci (8.3) (push) Canceled after 0s
tests / ci (8.4) (push) Canceled after 0s
tests / ci (8.5) (push) Canceled after 0s
first commit
2026-10-06 18:53:03 +02:00

28 lines
818 B
Svelte

<script lang="ts">
import { getContext } from 'svelte';
import { PanelLeftClose, PanelLeftOpen } from 'lucide-svelte';
import { Button } from '@/components/ui/button';
import { cn } from '@/lib/utils';
import { SIDEBAR_CONTEXT, type SidebarContext } from './context';
let { class: className = '' } = $props();
const { isMobile, state, toggleSidebar } = getContext<SidebarContext>(SIDEBAR_CONTEXT);
</script>
<Button
data-sidebar="trigger"
data-slot="sidebar-trigger"
variant="ghost"
size="icon"
class={cn('h-7 w-7', className)}
onclick={toggleSidebar}
>
{#if $isMobile || $state === 'collapsed'}
<PanelLeftOpen class="size-4" />
{:else}
<PanelLeftClose class="size-4" />
{/if}
<span class="sr-only">Toggle sidebar</span>
</Button>