mirror of
https://github.com/immich-app/immich.git
synced 2025-12-20 01:11:46 +03:00
17 lines
552 B
Svelte
17 lines
552 B
Svelte
<script lang="ts">
|
|
import type { ActionItem } from '$lib/types';
|
|
import { IconButton, type IconButtonProps } from '@immich/ui';
|
|
|
|
type Props = {
|
|
action: ActionItem;
|
|
};
|
|
|
|
const { action }: Props = $props();
|
|
const { title, icon, color = 'secondary', props: other = {}, onSelect } = $derived(action);
|
|
const onclick = (event: Event) => onSelect?.({ event, item: action });
|
|
</script>
|
|
|
|
{#if action.$if?.() ?? true}
|
|
<IconButton variant="ghost" {color} shape="round" {...other as IconButtonProps} {icon} aria-label={title} {onclick} />
|
|
{/if}
|