mirror of
https://github.com/immich-app/immich.git
synced 2025-12-23 01:11:36 +03:00
18 lines
505 B
Svelte
18 lines
505 B
Svelte
<script lang="ts">
|
|
import { type ActionItem, Button, Text } from '@immich/ui';
|
|
|
|
type Props = {
|
|
action: ActionItem;
|
|
title?: string;
|
|
};
|
|
|
|
const { action, title: titleAttr }: 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={titleAttr}>
|
|
<Text class="hidden md:block">{title}</Text>
|
|
</Button>
|
|
{/if}
|