mirror of
https://github.com/immich-app/immich.git
synced 2026-05-22 23:52:32 -04:00
3d075f2bf8
feat: plugins chore: better types feat: plugins
26 lines
576 B
Svelte
26 lines
576 B
Svelte
<script lang="ts">
|
|
import type { HeaderButtonActionItem } from '$lib/types';
|
|
import { Button, type Variants } from '@immich/ui';
|
|
|
|
type Props = {
|
|
action: HeaderButtonActionItem;
|
|
variant?: Variants;
|
|
};
|
|
|
|
const { action, variant }: Props = $props();
|
|
const { title, icon, color = 'secondary', onAction } = $derived(action);
|
|
</script>
|
|
|
|
{#if action.$if?.() ?? true}
|
|
<Button
|
|
variant={variant ?? 'ghost'}
|
|
size="small"
|
|
{color}
|
|
leadingIcon={icon}
|
|
onclick={() => onAction(action)}
|
|
title={action.data?.title}
|
|
>
|
|
{title}
|
|
</Button>
|
|
{/if}
|