import { Header } from "@/components/header";
import { Footer } from "@/components/footer";
import { WhatsAppFloat } from "@/components/whatsapp-float";
import { MobileCtaBar } from "@/components/mobile-cta-bar";
import { getSiteSettings } from "@/lib/data";
import { siteConfig } from "@/lib/site-config";
import Script from "next/script";
export default async function SiteLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  const settings = await getSiteSettings();
  const phoneRaw = settings?.contact_phone_raw ?? siteConfig.contact.phoneRaw;

  return (
    <>
      <Header />
      <main className="flex-1 pb-16 sm:pb-0">{children}</main>
      <Footer />
      <WhatsAppFloat
        phoneRaw={phoneRaw}
        message={settings?.whatsapp_message}
      />
      <MobileCtaBar
        phoneRaw={phoneRaw}
        whatsappRaw={phoneRaw}
        whatsappMessage={settings?.whatsapp_message}
      />
    </>
  );
}
