'use client'; import { type FC, type ReactNode } from 'react'; import { BRAND_HERO } from '@/lib/config/colors'; /** * Chat message for the hero preview */ export interface HeroChatMessage { role: 'bot' | 'user'; content: string; } /** * Badge/label configuration for hero section */ export interface HeroBadge { text: string; emoji?: string; } /** * Key benefit/feature displayed in hero */ export interface HeroKeyBenefit { emoji: string; text: string; } /** * CTA button configuration */ export interface HeroCTA { text: string; href: string; external?: boolean; } /** * Configuration for the hero section */ export interface BotHeroConfig { /** Badge shown above the title */ badge?: HeroBadge; /** Main title (bot name will be added automatically if titleSuffix is provided) */ title: string; /** Optional suffix added after title (e.g., "- AI Legal Assistant") */ titleSuffix?: string; /** Subtitle/overview text */ subtitle: string; /** Primary CTA button */ primaryCTA: HeroCTA; /** Secondary CTA button */ secondaryCTA?: HeroCTA; /** Bot info for chat preview */ botInfo: { name: string; emoji: string; description: string; }; /** Chat messages to display in preview */ chatMessages: HeroChatMessage[]; /** Key benefits to display (optional) */ keyBenefits?: HeroKeyBenefit[]; /** Whether to show key benefits on mobile separately */ showMobileBenefits?: boolean; } interface BotHeroSectionProps { config: BotHeroConfig; /** Optional custom content for the right panel instead of chat preview */ rightPanel?: ReactNode; } /** * Shared Hero Section component for bot pages * * @example * ```tsx * * ``` */ export const BotHeroSection: FC = ({ config, rightPanel }) => { const colors = BRAND_HERO; const { badge, title, titleSuffix, subtitle, primaryCTA, secondaryCTA, botInfo, chatMessages, keyBenefits, showMobileBenefits = false, } = config; return (
{/* Left side - Content */}
{badge && (
{badge.emoji && {badge.emoji}} {badge.text}
)}

{title} {titleSuffix && ( <> {title.endsWith(':') ? ' ' : ': '} {titleSuffix} )}

{subtitle}

{/* Mobile key benefits */} {showMobileBenefits && keyBenefits && keyBenefits.length > 0 && (

Key Benefits:

    {keyBenefits.slice(0, 3).map((benefit, idx) => (
  • ✓ {benefit.text}
  • ))}
)} {/* Desktop key benefits (when not showing mobile separately) */} {!showMobileBenefits && keyBenefits && keyBenefits.length > 0 && (
{keyBenefits.map((benefit, idx) => (
{benefit.emoji} {benefit.text}
))}
)}
{/* Right side - Chat preview or custom content */} {rightPanel || (
{/* Bot header */}
{botInfo.emoji}

{botInfo.name}

{botInfo.description}

{/* Chat messages */}
{chatMessages.map((message, idx) => (

{message.content}

))}
{/* Desktop key benefits inside chat panel */} {showMobileBenefits && keyBenefits && keyBenefits.length > 0 && (

Key Benefits:

{keyBenefits.slice(0, 4).map((benefit, idx) => (
✓ {benefit.text}
))}
)}
)}
); };