import { getServerLocale } from "@/lib/i18n/server";
import { Header } from "@/components/layout/Header";
import Footer from "@/components/layout/Footer";
import SectionDetailShell from "@/features/section/components/SectionDetailShell";

interface Props {
  params: Promise<{ id: string }>;
  searchParams: Promise<{ type?: string; title?: string }>;
}

export default async function SectionDetailPage({ params, searchParams }: Props) {
  const { id } = await params;
  const { type, title } = await searchParams;
  const locale = await getServerLocale();
  const sectionId = parseInt(id, 10);

  return (
    <div className="dt-fade-in">
      <Header locale={locale} />
      <SectionDetailShell
        sectionId={sectionId}
        sectionType={type ? parseInt(type, 10) : undefined}
        sectionTitle={title}
      />
      <Footer locale={locale} />
    </div>
  );
}
