1
0
mirror of https://github.com/immich-app/immich.git synced 2025-06-27 05:11:11 +02:00
Files
immich/web/src/lib/components/shared-components/context-menu/menu-option.svelte
Ben Basten fcc3b81745 feat(web, a11y): add labels! (#8354)
* feat(web, a11y): add labels!

* fix: move required prop to the top of the list
2024-03-29 08:48:07 -04:00

33 lines
682 B
Svelte

<script>
import Icon from '$lib/components/elements/icon.svelte';
export let text = '';
export let subtitle = '';
export let icon = '';
</script>
<button
on:click
class="w-full bg-slate-100 p-4 text-left text-sm font-medium text-immich-fg hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-inset dark:text-immich-dark-bg"
role="menuitem"
>
{#if text}
{#if icon}
<p class="flex gap-2">
<Icon path={icon} ariaHidden={true} size="18" />
{text}
</p>
{:else}
{text}
{/if}
{:else}
<slot />
{/if}
<slot name="subtitle">
<p class="text-xs text-gray-500">
{subtitle}
</p>
</slot>
</button>