import React from 'react';
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 extends React.HTMLAttributes {
logo?: {
url: string;
alt: string;
text?: string;
};
slogan?: string;
title: React.ReactNode;
subtitle: string;
callToAction: {
text: string;
href: string;
};
backgroundImage: string;
contactInfo: {
website: string;
phone: string;
address: string;
};
}
const HeroSection = React.forwardRef(
({ className, logo, slogan, title, subtitle, callToAction, 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",
},
},
};
return (
{/* Left Side: Content */}
{/* Top Section: Logo & Main Content */}
{logo && (
{logo.text &&
{logo.text}
}
{slogan &&
{slogan}
}
)}
{title}
{subtitle}
{callToAction.text}
{/* Bottom Section: Footer Info */}
{contactInfo.website}
{contactInfo.phone}
{contactInfo.address}
{/* Right Side: Image with Clip Path Animation */}
);
}
);
HeroSection.displayName = "HeroSection";
export { HeroSection };