"use client"; import React, { forwardRef } from "react"; import { HeroSectionProps } from "../../types"; import { Button } from "../ui/Button"; // Server Component version - no event handlers export const HeroSectionServer = forwardRef< HTMLElement, Omit >( ( { className = "", title = "Welcome to Our Platform", subtitle = "Build amazing applications with our component library", ctaText = "Get Started", backgroundImage, ctaHref, ctaTarget = "_self", children, ...props }, ref ) => { // Explicitly remove onCtaClick if it exists in props (runtime safety) // eslint-disable-next-line @typescript-eslint/no-unused-vars const { onCtaClick: _onCtaClick, ...safeProps } = props as Record< string, unknown >; const backgroundStyle = backgroundImage ? { backgroundImage: `url(${backgroundImage})` } : {}; const renderCTA = () => { if (!ctaHref) return null; return ( {ctaText} ); }; return (
{backgroundImage && (
)}

{title}

{subtitle && (

{subtitle}

)} {renderCTA()} {children}
); } ); HeroSectionServer.displayName = "HeroSectionServer"; // Client Component version - with event handlers export const HeroSectionClient = forwardRef( ( { className = "", title = "Welcome to Our Platform", subtitle = "Build amazing applications with our component library", ctaText = "Get Started", backgroundImage, onCtaClick, ctaHref, ctaTarget = "_self", children, ...props }, ref ) => { const backgroundStyle = backgroundImage ? { backgroundImage: `url(${backgroundImage})` } : {}; const renderCTA = () => { if (!onCtaClick && !ctaHref) return null; if (ctaHref) { // Use native anchor tag for external links or when Next.js Link is not available return ( {ctaText} ); } return ( ); }; return (
{backgroundImage && (
)}

{title}

{subtitle && (

{subtitle}

)} {renderCTA()} {children}
); } ); HeroSectionClient.displayName = "HeroSectionClient"; // Default export for backward compatibility (client component) export const HeroSection = HeroSectionClient;