import Image from "next/image"; import Link from "next/link"; import type { Metadata } from "next"; import { notFound } from "next/navigation"; import { ArrowRight, ArrowLeft, CheckCircle2 } from "lucide-react"; import { renderContent } from "@/lib/content-render"; import { getIndustryBySlug, listProjects, listServices, getSiteSettings, } from "@/lib/data"; import { buildMetadata } from "@/lib/seo"; import { ProjectsGrid } from "@/components/projects-grid"; import { ServicesGrid } from "@/components/services-grid"; import { TrustBand } from "@/components/trust-band"; import { Guarantee } from "@/components/guarantee"; import { QuickLeadForm } from "@/components/quick-lead-form"; import { FaqList } from "@/components/faq-list"; import { FaqLd } from "@/components/json-ld"; import { SectionTitle } from "@/components/section-title"; import type { FaqItem } from "@/lib/types"; export async function generateMetadata({ params, }: { params: Promise<{ slug: string }>; }): Promise { const { slug } = await params; const industry = await getIndustryBySlug(slug); if (!industry) return { title: "Sektör bulunamadı" }; return buildMetadata(`/sektor/${slug}`, { title: industry.seo_title || industry.title, description: industry.seo_description || industry.subtitle || undefined, }); } function parseFaq(items?: string[] | null): FaqItem[] { if (!items) return []; const out: FaqItem[] = []; for (const raw of items) { try { const obj = JSON.parse(raw) as Partial; if (obj.q && obj.a) out.push({ q: obj.q, a: obj.a }); } catch { /* ignore */ } } return out; } export default async function IndustryPage({ params, }: { params: Promise<{ slug: string }>; }) { const { slug } = await params; const industry = await getIndustryBySlug(slug); if (!industry) notFound(); const [services, projects, settings] = await Promise.all([ listServices(), listProjects({ limit: 6 }), getSiteSettings(), ]); const faqItems = parseFaq(industry.faq); const html = renderContent(industry.content); return ( <>
Anasayfa
Sektöre özel çözüm

{industry.title}

{industry.subtitle && (

{industry.subtitle}

)}
Ücretsiz keşif görüşmesi Ücretsiz site analizi
{industry.features && industry.features.length > 0 && (
    {industry.features.map((f) => (
  • {f}
  • ))}
)} {html && (
)} {projects.length > 0 && (
)} {services.length > 0 && (
)} {faqItems.length > 0 && (
)} ); }