import type { Metadata } from "next"; import { Save } from "lucide-react"; import { Field, FormActions, FormShell, PageHeader, PrimaryButton, Textarea, } from "@/components/admin/form"; import { getSiteSettings } from "@/lib/data"; import { saveSiteSettings } from "@/lib/admin-actions"; import type { StatItem } from "@/lib/types"; export const metadata: Metadata = { title: "Site Ayarları" }; function statsToText(items?: string[] | null): string { if (!items) return ""; const parsed: StatItem[] = []; for (const raw of items) { try { const obj = JSON.parse(raw) as Partial; if (obj.value && obj.label) parsed.push({ value: obj.value, label: obj.label }); } catch { /* ignore */ } } return parsed.map((s) => `${s.value} | ${s.label}`).join("\n"); } function Section({ title, description, children, }: { title: string; description?: string; children: React.ReactNode; }) { return (

{title}

{description && (

{description}

)}
{children}
); } export default async function SiteSettingsPage() { const s = await getSiteSettings(); return (