118 lines
3.5 KiB
Svelte
118 lines
3.5 KiB
Svelte
<script lang="ts">
|
|
import {
|
|
Archive,
|
|
Droplets,
|
|
Lock,
|
|
Unlock,
|
|
Image,
|
|
Minimize2,
|
|
Scissors,
|
|
Merge,
|
|
Stamp,
|
|
RotateCw,
|
|
Info,
|
|
FileText
|
|
} from '@lucide/svelte';
|
|
import { goto } from '$app/navigation';
|
|
import FileDropzone from '$lib/components/FileDropzone.svelte';
|
|
import * as Card from '$lib/components/ui/card/index';
|
|
import { queueZipFiles } from '$lib/pending-files';
|
|
import { isAcceptedWorkspaceFile, WORKSPACE_ACCEPT_TYPES } from '$lib/zip-selection';
|
|
import { tools } from '$lib/tools';
|
|
|
|
const iconMap: Record<string, typeof FileText> = {
|
|
droplets: Droplets,
|
|
lock: Lock,
|
|
unlock: Unlock,
|
|
image: Image,
|
|
minimize: Minimize2,
|
|
scissors: Scissors,
|
|
merge: Merge,
|
|
stamp: Stamp,
|
|
'rotate-cw': RotateCw,
|
|
info: Info
|
|
};
|
|
|
|
const openBeaFiles = (files: File[]) => {
|
|
const workspaceFiles = files.filter(isAcceptedWorkspaceFile);
|
|
if (workspaceFiles.length === 0) return;
|
|
|
|
queueZipFiles(workspaceFiles);
|
|
void goto('/tools/bea');
|
|
};
|
|
|
|
const handleWindowDragOver = (event: DragEvent) => {
|
|
if (!event.dataTransfer?.types.includes('Files')) return;
|
|
event.preventDefault();
|
|
};
|
|
|
|
const handleWindowDrop = (event: DragEvent) => {
|
|
if (!event.dataTransfer?.files.length) return;
|
|
event.preventDefault();
|
|
openBeaFiles(Array.from(event.dataTransfer.files));
|
|
};
|
|
</script>
|
|
|
|
<svelte:head>
|
|
<title>beA-Edit — Werkzeugkasten für das besondere elektronische Anwaltspostfach</title>
|
|
</svelte:head>
|
|
|
|
<svelte:window ondragover={handleWindowDragOver} ondrop={handleWindowDrop} />
|
|
|
|
<div class="flex flex-col gap-10 px-4 py-10">
|
|
<!-- Hero -->
|
|
<div class="flex flex-col items-center gap-2 text-center">
|
|
<h1 class="text-[28px] font-bold text-primary-900">Werkzeugkasten für beA</h1>
|
|
<p class="max-w-lg text-[15px] font-medium text-primary-700">
|
|
Bereiten Sie ZIP-Archive aus dem besonderen elektronischen Anwaltspostfach (beA) auf — plus
|
|
praktische PDF-Werkzeuge.
|
|
</p>
|
|
<p class="max-w-lg text-[13px] text-primary-700">
|
|
Alle Werkzeuge laufen zu 100 % in Ihrem Browser — keine Dateien werden hochgeladen.
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Workspace entry point -->
|
|
<div class="mx-auto w-full max-w-2xl">
|
|
<FileDropzone
|
|
onFilesSelected={openBeaFiles}
|
|
accept={WORKSPACE_ACCEPT_TYPES}
|
|
multiple={true}
|
|
ariaLabel="beA-ZIP oder PDF öffnen"
|
|
label="beA-ZIP oder PDF öffnen"
|
|
sublabel="ZIP aus dem besonderen elektronischen Anwaltspostfach (beA) oder eine PDF-Datei hier ablegen oder zum Auswählen klicken"
|
|
icon={Archive}
|
|
class="py-10"
|
|
/>
|
|
<p class="mt-2 text-center text-[12px] text-primary-600">
|
|
Tipp: In beA exportierte Archive enden auf .zip und enthalten Ihre Anlagen als PDF. PDFs
|
|
können direkt in Teildokumente aufgeteilt werden.
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Tool grid -->
|
|
<div class="mx-auto w-full max-w-4xl">
|
|
<h2 class="mb-4 text-[18px] font-bold text-primary-900">Weitere PDF-Werkzeuge</h2>
|
|
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
|
{#each tools as tool}
|
|
{@const Icon = iconMap[tool.icon] ?? FileText}
|
|
<a href="/tools/{tool.slug}" class="block">
|
|
<Card.Root class="h-full transition hover:shadow-md cursor-pointer">
|
|
<Card.Content class="flex flex-col gap-3 py-6">
|
|
<div
|
|
class="flex h-10 w-10 items-center justify-center rounded-xl bg-primary/10 text-primary"
|
|
>
|
|
<Icon class="h-5 w-5" />
|
|
</div>
|
|
<div>
|
|
<h3 class="text-[15px] font-bold text-primary-900">{tool.title}</h3>
|
|
<p class="mt-1 text-[13px] leading-snug text-primary-700">{tool.description}</p>
|
|
</div>
|
|
</Card.Content>
|
|
</Card.Root>
|
|
</a>
|
|
{/each}
|
|
</div>
|
|
</div>
|
|
</div>
|