2023-04-12 18:37:52 +03:00
|
|
|
<script lang="ts">
|
2023-07-01 00:50:47 -04:00
|
|
|
import empty1Url from '$lib/assets/empty-1.svg';
|
2023-04-12 18:37:52 +03:00
|
|
|
|
2024-11-14 08:43:25 -06:00
|
|
|
interface Props {
|
|
|
|
|
onClick?: undefined | (() => unknown);
|
|
|
|
|
text: string;
|
|
|
|
|
fullWidth?: boolean;
|
|
|
|
|
src?: string;
|
2025-05-15 09:35:21 -06:00
|
|
|
title?: string;
|
2024-11-14 08:43:25 -06:00
|
|
|
}
|
2023-04-12 18:37:52 +03:00
|
|
|
|
2025-05-15 09:35:21 -06:00
|
|
|
let { onClick = undefined, text, fullWidth = false, src = empty1Url, title }: Props = $props();
|
2024-11-14 08:43:25 -06:00
|
|
|
|
|
|
|
|
let width = $derived(fullWidth ? 'w-full' : 'w-1/2');
|
2023-10-13 14:47:31 -04:00
|
|
|
|
2024-03-12 02:18:47 +01:00
|
|
|
const hoverClasses = onClick
|
|
|
|
|
? `border dark:border-immich-dark-gray hover:bg-immich-primary/5 dark:hover:bg-immich-dark-primary/25`
|
2023-10-13 14:47:31 -04:00
|
|
|
: '';
|
2023-04-12 18:37:52 +03:00
|
|
|
</script>
|
|
|
|
|
|
2024-11-14 08:43:25 -06:00
|
|
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
2024-03-12 02:18:47 +01:00
|
|
|
<svelte:element
|
|
|
|
|
this={onClick ? 'button' : 'div'}
|
2024-11-14 08:43:25 -06:00
|
|
|
onclick={onClick}
|
2023-10-13 14:47:31 -04:00
|
|
|
class="{width} m-auto mt-10 flex flex-col place-content-center place-items-center rounded-3xl bg-gray-50 p-5 dark:bg-immich-dark-gray {hoverClasses}"
|
|
|
|
|
>
|
2024-03-12 02:18:47 +01:00
|
|
|
<img {src} alt="" width="500" draggable="false" />
|
2025-05-15 09:35:21 -06:00
|
|
|
|
|
|
|
|
{#if title}
|
|
|
|
|
<h2 class="text-xl font-medium my-4">{title}</h2>
|
|
|
|
|
{/if}
|
|
|
|
|
<p class="text-immich-text-gray-500 dark:text-immich-dark-fg font-light">{text}</p>
|
2024-03-12 02:18:47 +01:00
|
|
|
</svelte:element>
|