import { Save } from "lucide-react"; import { Checkbox, Field, FormActions, FormShell, GhostLink, PageHeader, PrimaryButton, Textarea, } from "@/components/admin/form"; import { MediaPicker } from "@/components/admin/media-picker"; import { RichEditor } from "@/components/admin/rich-editor"; import { saveIndustry } from "@/lib/admin-actions"; import type { FaqItem, IndustryRow } from "@/lib/types"; function faqToText(items?: string[] | null): string { if (!items) return ""; const parsed: FaqItem[] = []; for (const raw of items) { try { const obj = JSON.parse(raw) as Partial; if (obj.q && obj.a) parsed.push({ q: obj.q, a: obj.a }); } catch { /* ignore */ } } return parsed.map((it) => `${it.q}\n${it.a}`).join("\n---\n"); } export function IndustryForm({ row }: { row?: IndustryRow }) { return (
{row && }