'use client'
import React from 'react';
import Image from 'next/image';
import { cn } from "@/lib/utils";
import { motion } from 'framer-motion';
// Icon component for contact details
const InfoIcon = ({ type }: { type: 'website' | 'phone' | 'address' }) => {
const icons = {
website: (
),
phone: (
),
address: (
),
};
return
{icons[type]}
;
};
// Prop types for the HeroSection component
interface HeroSectionProps {
logo?: {
url: string;
alt: string;
text?: string;
};
slogan?: string;
title: React.ReactNode;
subtitle: string | React.ReactNode;
punchline?: string | React.ReactNode;
callToAction: {
text: string;
href: string;
};
secondaryCallToAction?: {
text: string;
href: string;
};
backgroundImage: string;
contactInfo?: {
website: string;
phone: string;
address: string;
};
className?: string;
}
const HeroSection = React.forwardRef(
({ className, logo, slogan, title, subtitle, punchline, callToAction, secondaryCallToAction, backgroundImage, contactInfo, ...props }, ref) => {
// Animation variants for the container to orchestrate children animations
const containerVariants = {
hidden: { opacity: 0 },
visible: {
opacity: 1,
transition: {
staggerChildren: 0.15,
delayChildren: 0.2,
},
},
};
// Animation variants for individual text/UI elements
const itemVariants = {
hidden: { y: 20, opacity: 0 },
visible: {
y: 0,
opacity: 1,
transition: {
duration: 0.5,
ease: "easeOut" as const,
},
},
};
return (
{/* Left Side: Content */}
{/* Top Section: Logo & Main Content */}
{/* Bottom Section: Footer Info */}
{contactInfo && (
{contactInfo.website}
{contactInfo.phone}
{contactInfo.address}
)}
{/* Right Side: Image with Clip Path Animation */}
);
}
);
HeroSection.displayName = "HeroSection";
export { HeroSection };