import Navbar from "@/components/Navbar";
import Footer from "@/components/Footer";
import { getDictionary } from "@/i18n/getDictionary";
import { getSettings } from "@/app/actions/adminData";

export default async function PublicLayout({
  children,
  params,
}: {
  children: React.ReactNode;
  params: Promise<{ lang: string }>;
}) {
  const { lang } = await params;
  const dict = await getDictionary(lang as "fr" | "ar");
  const settings = await getSettings();

  return (
    <>
      <Navbar dict={dict} lang={lang} />
      <main className="min-h-screen">
        {children}
      </main>
      <Footer dict={dict.footer} settings={settings} />
    </>
  );
}
