import FooterSimpleMedia from '@/components/sections/footer/FooterSimpleMedia';
import NavbarFloatingLogo from '@/components/ui/NavbarFloatingLogo';
import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary";
import SiteBackgroundSlot from "@/components/ui/SiteBackgroundSlot";
import { Outlet } from 'react-router-dom';
import { StyleProvider } from "@/components/ui/StyleProvider";

export default function Layout() {
  const navItems = [
    { name: "Features", href: "#about" },
    { name: "Fleet", href: "#fleet" },
    { name: "Pricing", href: "#pricing" },
    { name: "FAQ", href: "#faq" },
    { name: "Hero", href: "#hero" },
    { name: "Metrics", href: "#metrics" },
    { name: "Testimonials", href: "#testimonials" }
  ];

  return (
    <StyleProvider buttonVariant="bubble" siteBackground="noise" heroBackground="cornerGlow">
      <SiteBackgroundSlot />
      <SectionErrorBoundary name="navbar">
        <NavbarFloatingLogo
          logo="DriveEase"
          logoImageSrc="http://img.b2bpic.net/free-vector/car-rental-25-versatile-vector-designs-all-your-rental-needs_1142-22319.jpg"
          ctaButton={{
            text: "Book Now",            href: "#contact"}}
          navItems={navItems}
        />
      </SectionErrorBoundary>
      <main className="flex-grow">
        <Outlet />
      </main>
      <SectionErrorBoundary name="footer">
        <FooterSimpleMedia
          imageSrc="http://img.b2bpic.net/free-photo/woman-making-desicion-buy-car_1303-13859.jpg"
          brand="DriveEase"
          columns={[
            {
              title: "Company",              items: [
                { label: "About", href: "#about" },
                { label: "Careers", href: "#" },
              ],
            },
            {
              title: "Legal",              items: [
                { label: "Privacy Policy", href: "#" },
                { label: "Terms of Service", href: "#" },
              ],
            },
          ]}
          copyright="© 2024 DriveEase. All rights reserved."
          links={[
            { label: "Home", href: "/" },
            { label: "Fleet", href: "#fleet" },
          ]}
        />
      </SectionErrorBoundary>
    </StyleProvider>
  );
}