import HeroSection from "./_components/HeroSection"; // Import the HeroSection component import ClientLogosSection, { defaultClients, } from "./_components/ClientLogosSection"; // Import component and data import CallToActionSection from "./_components/CallToActionSection"; import CoreServicesSection, { defaultCoreServices, } from "./_components/CoreServicesSection"; import WhyChooseUsSection, { defaultWhyChooseUsFeatures, } from "./_components/WhyChooseUsSection"; import FeaturedProductSection, { defaultObseFeatures, } from "./_components/FeaturedProductSection"; import { getHome } from "@/lib/query/home"; export default async function HomePage() { // Explicitly type the data variable, assuming getHome returns HeroSectionType or null/undefined const data = await getHome(); // Handle case where data might be null or undefined if (!data) { // Optionally return a loading state or default content return
Loading hero section...
; // Or render the HeroSection with default props if preferred } return ( <> {data?.hero_title}
} subtitle={ data.hero_subtitle || "Your trusted partner in technology solutions." } // Use optional chaining and provide a default buttonText={data.hero_buttons?.[0]?.label || "Learn More"} // Use optional chaining and provide a default buttonHref={data.hero_buttons?.[0]?.link || "/about"} // Use optional chaining and provide a default imageUrl={ // data.hero_cover // ? `${process.env.DIRECTUS_API_ENDPOINT}/assets/${data.hero_cover}` // : "/hero-bg-2.jpg" "/banner-1.jpeg" } // Use optional chaining and provide a default /> {/* TODO: Implement actual client logo fetching and display */} {/* TODO: Add auto-sliding carousel for clients */} ); }