2023-04-01 06:53:20 +02:00
|
|
|
<script lang="ts" context="module">
|
2023-07-01 00:50:47 -04:00
|
|
|
export type Color = 'primary' | 'secondary';
|
|
|
|
|
export type Rounded = false | true | 'full';
|
2023-04-01 06:53:20 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
2023-07-01 00:50:47 -04:00
|
|
|
export let color: Color = 'primary';
|
|
|
|
|
export let rounded: Rounded = true;
|
2023-04-01 06:53:20 +02:00
|
|
|
|
2023-07-01 00:50:47 -04:00
|
|
|
const colorClasses: Record<Color, string> = {
|
|
|
|
|
primary: 'text-gray-100 dark:text-immich-dark-gray bg-immich-primary dark:bg-immich-dark-primary',
|
|
|
|
|
secondary: 'text-immich-dark-bg dark:text-immich-gray dark:bg-gray-600 bg-gray-300 dark:text-immich-gray',
|
|
|
|
|
};
|
2023-04-01 06:53:20 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<span
|
2023-12-05 10:07:20 +08:00
|
|
|
class="inline-block h-min whitespace-nowrap px-3 py-1 text-center align-baseline text-xs leading-none {colorClasses[
|
2023-07-01 00:50:47 -04:00
|
|
|
color
|
|
|
|
|
]}"
|
|
|
|
|
class:rounded-md={rounded === true}
|
|
|
|
|
class:rounded-full={rounded === 'full'}
|
2023-04-01 06:53:20 +02:00
|
|
|
>
|
2023-07-01 00:50:47 -04:00
|
|
|
<slot />
|
2023-04-01 06:53:20 +02:00
|
|
|
</span>
|