Files
immich/web/src/lib/components/shared-components/Qrcode.svelte
T
Daniel Dietzler 5e9bda7fab chore: tailwind linting (#28165)
chore: tailwind cannonical classes
2026-05-01 00:18:03 -04:00

21 lines
466 B
Svelte

<script lang="ts">
import QRCode from 'qrcode';
import { t } from 'svelte-i18n';
type Props = {
value: string;
width: number;
alt?: string;
};
const { value, width, alt = $t('alt_text_qr_code') }: Props = $props();
let promise = $derived(QRCode.toDataURL(value, { margin: 4, width }));
</script>
<div style="width: {width}px; height: {width}px">
{#await promise then url}
<img src={url} {alt} class="size-full" />
{/await}
</div>