'use client'; import React from 'react'; import Link from 'next/link'; import { motion } from 'framer-motion'; interface HeroProps { title: string; subtitle: string; primaryButtonText: string; primaryButtonLink: string; secondaryButtonText?: string; secondaryButtonLink?: string; backgroundImageUrl?: string; } const Hero: React.FC = ({ title, subtitle, primaryButtonText, primaryButtonLink, secondaryButtonText, secondaryButtonLink, backgroundImageUrl, }) => { // Animation variants const containerVariants = { hidden: { opacity: 0 }, visible: { opacity: 1, transition: { staggerChildren: 0.2, delayChildren: 0.1, }, }, }; const itemVariants = { hidden: { y: 20, opacity: 0 }, visible: { y: 0, opacity: 1, transition: { duration: 0.5, ease: 'easeOut', }, }, }; // Dynamic styles based on background image const bgStyle = backgroundImageUrl ? { backgroundImage: `linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7)), url(${backgroundImageUrl})`, backgroundSize: 'cover', backgroundPosition: 'center', } : {}; // Default class for hero section (with or without bg image) const heroClass = backgroundImageUrl ? 'text-white' : 'hero-section'; // Background style only for custom background images const backgroundStyle = backgroundImageUrl ? bgStyle : {}; return (
{title} {subtitle} {primaryButtonText} {secondaryButtonText && secondaryButtonLink && ( {secondaryButtonText} )}
); }; export default Hero;