2025-11-11 07:42:33 -05:00
|
|
|
<script lang="ts">
|
2025-11-25 16:35:37 -05:00
|
|
|
import { type ActionItem, Button, Text } from '@immich/ui';
|
2025-11-11 07:42:33 -05:00
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
action: ActionItem;
|
2025-11-25 16:35:37 -05:00
|
|
|
title?: string;
|
2025-11-11 07:42:33 -05:00
|
|
|
};
|
|
|
|
|
|
2025-11-25 16:35:37 -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}
|
2025-11-25 16:35:37 -05:00
|
|
|
<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}
|