mirror of
https://github.com/immich-app/immich.git
synced 2025-12-12 09:13:09 +03:00
25 lines
515 B
Svelte
25 lines
515 B
Svelte
<script lang="ts">
|
|
import type { HeaderButtonActionItem } from '$lib/types';
|
|
import { Button } from '@immich/ui';
|
|
|
|
type Props = {
|
|
action: HeaderButtonActionItem;
|
|
};
|
|
|
|
const { action }: Props = $props();
|
|
const { title, icon, color = 'secondary', onAction } = $derived(action);
|
|
</script>
|
|
|
|
{#if action.$if?.() ?? true}
|
|
<Button
|
|
variant="ghost"
|
|
size="small"
|
|
{color}
|
|
leadingIcon={icon}
|
|
onclick={() => onAction(action)}
|
|
title={action.data?.title}
|
|
>
|
|
{title}
|
|
</Button>
|
|
{/if}
|