"use client"; import { useEffect, useState } from "react"; import Image from "next/image"; import Link from "next/link"; import { loadCurrentBook, type CurrentBook } from "../tisch/currentBook"; import type { WindowLabels, WindowRequest } from "./types"; const EMAIL = "contact@dk0.dev"; const btn = "inline-flex items-center gap-2 rounded-full bg-ink px-4 py-2.5 text-sm font-semibold text-paper transition-transform duration-150 ease-out active:scale-[0.97]"; const ghost = "inline-flex items-center gap-2 rounded-full px-4 py-2.5 text-sm font-semibold shadow-[inset_0_0_0_1.5px_rgb(var(--plakat-ink))] transition-[background-color,color,transform] duration-150 ease-out hover:bg-ink hover:text-paper active:scale-[0.97]"; /** Titelzeile eines Fensters, auch für die Ablage-Leiste. */ export function windowTitle(req: WindowRequest, labels: WindowLabels): string { switch (req.kind) { case "project": return req.project.year ? `${req.project.title} · ${req.project.year}` : req.project.title; case "now": return labels.now.title; case "server": return labels.server.title; case "read": return labels.read.title; case "about": return labels.about.title; case "contact": return labels.contact.title; } } /** Farbe des Punkts in der Ablage-Leiste */ export function windowAccent(req: WindowRequest): string { if (req.kind === "project") return req.project.color; return { now: "rgb(var(--plakat-red))", server: "rgb(var(--plakat-ok))", read: "#7a5240", about: "#2f5bea", contact: "rgb(var(--plakat-red))" }[req.kind]; } interface WindowContentProps { req: WindowRequest; labels: WindowLabels; /** Schließt das Fenster, z. B. wenn ein Link auf der Seite weiterführt */ onClose: () => void; } export default function WindowContent({ req, labels, onClose }: WindowContentProps) { switch (req.kind) { case "project": { const p = req.project; return ( <>
{p.description}
{labels.server.headline}
{labels.server.note}
> ); case "read": return{text}
))}{labels.now.days}
{labels.read.empty}
)} {labels.read.library} > ); } function ContactBody({ labels, onClose }: { labels: WindowLabels; onClose: () => void }) { const [copied, setCopied] = useState(false); const copy = async () => { try { await navigator.clipboard.writeText(EMAIL); setCopied(true); setTimeout(() => setCopied(false), 1600); } catch { window.location.href = `mailto:${EMAIL}`; } }; return ( <>{labels.contact.body}
> ); }