2023-04-01 22:46:07 +02:00
|
|
|
<script lang="ts" context="module">
|
2024-10-03 21:58:28 -04:00
|
|
|
export type Colors = 'light-gray' | 'gray' | 'dark-gray';
|
2023-04-01 22:46:07 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
2023-07-01 00:50:47 -04:00
|
|
|
export let color: Colors;
|
2023-08-18 00:55:26 -04:00
|
|
|
export let disabled = false;
|
2023-04-01 22:46:07 +02:00
|
|
|
|
2023-07-01 00:50:47 -04:00
|
|
|
const colorClasses: Record<Colors, string> = {
|
2024-10-03 21:58:28 -04:00
|
|
|
'light-gray': 'bg-gray-300/80 dark:bg-gray-700',
|
|
|
|
|
gray: 'bg-gray-300/90 dark:bg-gray-700/90',
|
|
|
|
|
'dark-gray': 'bg-gray-300 dark:bg-gray-700/80',
|
2023-07-01 00:50:47 -04:00
|
|
|
};
|
2023-08-18 00:55:26 -04:00
|
|
|
|
|
|
|
|
const hoverClasses = disabled
|
|
|
|
|
? 'cursor-not-allowed'
|
|
|
|
|
: 'hover:bg-immich-primary hover:text-white dark:hover:bg-immich-dark-primary dark:hover:text-black';
|
2023-04-01 22:46:07 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<button
|
2024-05-27 09:06:15 +02:00
|
|
|
type="button"
|
2023-08-18 00:55:26 -04:00
|
|
|
{disabled}
|
|
|
|
|
class="flex h-full w-full flex-col place-content-center place-items-center gap-2 px-8 py-2 text-xs text-gray-600 transition-colors dark:text-gray-200 {colorClasses[
|
2023-07-01 00:50:47 -04:00
|
|
|
color
|
2023-08-18 00:55:26 -04:00
|
|
|
]} {hoverClasses}"
|
2023-07-01 00:50:47 -04:00
|
|
|
on:click
|
2023-04-01 22:46:07 +02:00
|
|
|
>
|
2023-07-01 00:50:47 -04:00
|
|
|
<slot />
|
2023-04-01 22:46:07 +02:00
|
|
|
</button>
|