immich/web/src/lib/components/TableButton.svelte

16 lines
422 B
Svelte
Raw Normal View History

2025-11-11 07:42:33 -05:00
<script lang="ts">
2025-12-22 11:09:11 -05:00
import { IconButton, type ActionItem, type Size } from '@immich/ui';
2025-11-11 07:42:33 -05:00
type Props = {
action: ActionItem;
2025-12-22 11:09:11 -05:00
size?: Size;
2025-11-11 07:42:33 -05:00
};
2025-12-22 11:09:11 -05:00
const { action, size }: Props = $props();
const { title, icon, onAction } = $derived(action);
2025-11-11 07:42:33 -05:00
</script>
2026-01-07 16:21:19 -05:00
{#if icon && (action.$if?.() ?? true)}
2025-12-22 11:09:11 -05:00
<IconButton {size} shape="round" color="primary" {icon} aria-label={title} onclick={() => onAction(action)} />
2025-11-11 07:42:33 -05:00
{/if}