Files
CollabTable/shared/packages/web-ui/src/lib/components/AboutDialog.svelte
T
Gabriel20xx f208697859
Docker / Docker Build & Push (push) Successful in 8m26s
Lint / Lint (push) Failing after 20s
Tests / Go backend (push) Successful in 16s
Tests / Dashboard checks (push) Successful in 23s
Apply shared UI and workflow fixes
2026-08-07 15:22:26 +02:00

64 lines
1.3 KiB
Svelte

<script lang="ts">
import type { Snippet } from 'svelte';
import type { AboutLink } from '../types';
import Dialog from './Dialog.svelte';
let {
brand = 'Application',
children,
description = '',
icon,
links = [],
onClose,
open = $bindable(false),
version = ''
}: {
brand?: string;
children?: Snippet;
description?: string;
icon?: Snippet;
links?: AboutLink[];
onClose?: () => void | Promise<void>;
open?: boolean;
version?: string;
} = $props();
let wasOpen = false;
$effect(() => {
if (wasOpen && !open) void onClose?.();
wasOpen = open;
});
</script>
<Dialog bind:open title={`About ${brand}`}>
<div class="sc-auth-brand">
{#if icon}
{@render icon()}
{:else}
<span aria-hidden="true" class="sc-brand-mark">{brand.slice(0, 1).toUpperCase()}</span>
{/if}
<strong>{brand}</strong>
</div>
{#if version}
<p class="sc-muted">Version {version}</p>
{/if}
{#if description}
<p class="sc-muted">{description}</p>
{/if}
{#if children}
{@render children()}
{/if}
{#if links.length > 0}
<div class="sc-about-links">
{#each links as link}
<a href={link.href} rel="noreferrer" target="_blank">{link.label}</a>
{/each}
</div>
{/if}
</Dialog>