You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-06-27 05:11:11 +02:00
27 lines
477 B
Svelte
27 lines
477 B
Svelte
<script>
|
|
import { createEventDispatcher } from 'svelte';
|
|
|
|
export let isDisabled = false;
|
|
export let text = '';
|
|
|
|
const dispatch = createEventDispatcher();
|
|
|
|
const handleClick = () => {
|
|
if (isDisabled) return;
|
|
|
|
dispatch('click');
|
|
};
|
|
</script>
|
|
|
|
<button
|
|
class:disabled={isDisabled}
|
|
on:click={handleClick}
|
|
class="bg-white hover:bg-gray-300 dark:text-immich-dark-bg transition-all p-4 w-full text-left text-sm"
|
|
>
|
|
{#if text}
|
|
{text}
|
|
{:else}
|
|
<slot />
|
|
{/if}
|
|
</button>
|