Files
immich/web/src/lib/components/HeaderButton.svelte

18 lines
505 B
Svelte
Raw Normal View History

2025-11-11 07:42:33 -05:00
<script lang="ts">
import { type ActionItem, Button, Text } from '@immich/ui';
2025-11-11 07:42:33 -05:00
type Props = {
action: ActionItem;
title?: string;
2025-11-11 07:42:33 -05:00
};
const { action, title: titleAttr }: Props = $props();
const { title, icon, color = 'secondary', onAction } = $derived(action);
2025-11-11 07:42:33 -05:00
</script>
{#if action.$if?.() ?? true}
<Button variant="ghost" size="small" {color} leadingIcon={icon} onclick={() => onAction(action)} title={titleAttr}>
2025-11-11 07:42:33 -05:00
<Text class="hidden md:block">{title}</Text>
</Button>
{/if}