import React from "react";
import { notFound } from "next/navigation";
import { LegalLayout } from "@/components/LegalLayout";

interface PageProps {
  params: Promise<{ locale: string }>;
}

export default async function Page({ params }: PageProps) {
  const { locale } = await params;

  let Content: React.ComponentType;
  try {
    const mdx = await import(`@/content/${locale}/datenschutz.mdx`);
    Content = mdx.default;
  } catch (e) {
    notFound();
  }

  return (
    <LegalLayout title="Datenschutz">
      <Content />
    </LegalLayout>
  );
}
