Werkstatt-App: öffentliche PWA und Redaktions-Backend
Werbefreie, barrierearme Info-App für Werkstätten (WfbM) auf Basis von SvelteKit, Tailwind, SQLite/Drizzle: - App: Startseite mit Kacheln, Meldungen, Seitenbaum, Termine inkl. Schließzeiten und iCal-Abo, Ansprechpartner, Suche, Kontaktformular, Merkliste, Vorlesen, Leichte Sprache, Schriftgrößen, Hell/Dunkel, PWA - Redaktion: Dashboard, Meldungen, Seiten, Termine, Kacheln, Ansprechpartner, Mediathek mit Bildoptimierung, Postfach, Benutzer mit Rollen, Einstellungen (Name, Logo, Farbe, Rechtstexte) - Demo-Seed, CLI zum Anlegen von Benutzern, Dockerfile und Compose Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4f145116d8
commit
bef8574e07
143 changed files with 13518 additions and 1 deletions
36
src/lib/components/Attachments.svelte
Normal file
36
src/lib/components/Attachments.svelte
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<script lang="ts">
|
||||
import FileText from '@lucide/svelte/icons/file-text';
|
||||
import FileImage from '@lucide/svelte/icons/file-image';
|
||||
import FileAudio from '@lucide/svelte/icons/file-audio';
|
||||
import FileVideo from '@lucide/svelte/icons/file-video';
|
||||
import Download from '@lucide/svelte/icons/download';
|
||||
import type { AttachmentItem } from '$lib/types';
|
||||
|
||||
let { items }: { items: AttachmentItem[] } = $props();
|
||||
|
||||
const iconFor = (mime: string) =>
|
||||
mime.startsWith('image/') ? FileImage : mime.startsWith('audio/') ? FileAudio : mime.startsWith('video/') ? FileVideo : FileText;
|
||||
const size = (b: number) => (b > 1e6 ? `${(b / 1e6).toFixed(1).replace('.', ',')} MB` : `${Math.max(1, Math.round(b / 1e3))} KB`);
|
||||
const kind = (mime: string, name: string) => (mime === 'application/pdf' ? 'PDF' : (name.split('.').pop() ?? '').toUpperCase());
|
||||
</script>
|
||||
|
||||
{#if items.length}
|
||||
<section class="space-y-2">
|
||||
<h2 class="eyebrow">Dokumente</h2>
|
||||
<ul class="card divide-y divide-line/70 overflow-hidden">
|
||||
{#each items as a (a.file.id)}
|
||||
{@const Ico = iconFor(a.file.mimeType)}
|
||||
<li>
|
||||
<a href={a.file.url} target="_blank" rel="noopener" class="flex items-center gap-3 px-4 py-3 hover:bg-surface-2">
|
||||
<span class="grid place-items-center size-10 rounded-xl bg-brand-soft text-brand-ink shrink-0"><Ico class="size-5" /></span>
|
||||
<span class="flex-1 min-w-0">
|
||||
<span class="block font-semibold truncate">{a.title}</span>
|
||||
<span class="block text-xs text-ink-3">{kind(a.file.mimeType, a.file.name)} · {size(a.file.size)}</span>
|
||||
</span>
|
||||
<Download class="size-5 text-ink-3" />
|
||||
</a>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
</section>
|
||||
{/if}
|
||||
Loading…
Add table
Add a link
Reference in a new issue