"use client"; import { useMemo, useState } from "react"; import type { MediaFile } from "@/lib/admin/media"; import type { ContentDocuments, ContentKey, LinkContent, PageContent, ServiceContent, TextBlockContent } from "@/lib/content/types"; type Viewport = "desktop" | "tablet" | "mobile"; type ContentTabId = ContentKey | "footer" | "global-seo" | "general-settings"; const tabs: Array<{ id: ContentTabId; key: ContentKey; label: string }> = [ { id: "home", key: "home", label: "Startseite" }, { id: "services", key: "services", label: "Leistungen" }, { id: "radio-service", key: "radio-service", label: "Funkgeräte-Service" }, { id: "about", key: "about", label: "Über Uns" }, { id: "contact", key: "contact", label: "Kontakt" }, { id: "footer", key: "settings", label: "Footer" }, { id: "global-seo", key: "settings", label: "SEO" }, { id: "general-settings", key: "settings", label: "Allgemeine Einstellungen" }, ]; type Props = { initialContent: ContentDocuments; mediaFiles: MediaFile[]; }; type ApiResponse = { message?: string; content?: ContentDocuments[K]; }; function linesToText(lines: string[]) { return lines.join("\n"); } function textToLines(value: string) { return value.split("\n").map((line) => line.trim()).filter(Boolean); } function updateLink(link: LinkContent, field: keyof LinkContent, value: string): LinkContent { return { ...link, [field]: value }; } function TextInput({ label, value, onChange }: { label: string; value: string; onChange: (value: string) => void }) { return ( ); } function TextArea({ label, value, onChange, rows = 4 }: { label: string; value: string; rows?: number; onChange: (value: string) => void }) { return (