mirror of
https://github.com/immich-app/static-pages.git
synced 2026-09-30 13:23:05 +08:00
39 lines
1.2 KiB
Svelte
39 lines
1.2 KiB
Svelte
<script lang="ts">
|
|
import { siteMetadata } from '$lib';
|
|
import PageContent from '$lib/components/PageContent.svelte';
|
|
import { Card, CardBody, Container, Heading, SiteMetadata, Text } from '@immich/ui';
|
|
import { DateTime } from 'luxon';
|
|
import type { Snippet } from 'svelte';
|
|
|
|
type Props = {
|
|
doc: { attributes: { title: string; description: string; updatedAt: string } };
|
|
children?: Snippet;
|
|
};
|
|
|
|
let { doc, children }: Props = $props();
|
|
|
|
const updatedAt = $derived(DateTime.fromISO(doc.attributes.updatedAt).setZone('UTC'));
|
|
const pageMetadata = $derived({
|
|
title: doc.attributes.title,
|
|
description: doc.attributes.description,
|
|
});
|
|
</script>
|
|
|
|
<SiteMetadata site={siteMetadata} page={pageMetadata} />
|
|
|
|
<PageContent>
|
|
<Container size="medium" center>
|
|
<section class="flex flex-col gap-2">
|
|
<Heading tag="h1" size="title">{pageMetadata.title}</Heading>
|
|
<Text color="muted">Last updated: {updatedAt.toLocaleString(DateTime.DATE_FULL)}</Text>
|
|
<Text>{pageMetadata.description}</Text>
|
|
</section>
|
|
|
|
<Card color="secondary" class="mt-8">
|
|
<CardBody class="pt-0">
|
|
{@render children?.()}
|
|
</CardBody>
|
|
</Card>
|
|
</Container>
|
|
</PageContent>
|