'use client'; import Scribble from '@/components/Scribble'; import { Button, Container, Heading, Section } from '@/components/ui'; import { useTranslations, useLocale } from 'next-intl'; import dynamic from 'next/dynamic'; import { useAnalytics } from '../analytics/useAnalytics'; import { AnalyticsEvents } from '../analytics/analytics-events'; import AIOrb from '../search/AIOrb'; import { useState } from 'react'; import { ChevronRight } from 'lucide-react'; import { AISearchResults } from '../search/AISearchResults'; const HeroIllustration = dynamic(() => import('./HeroIllustration'), { ssr: false }); export default function Hero({ data }: { data?: any }) { const t = useTranslations('Home.hero'); const locale = useLocale(); const { trackEvent } = useAnalytics(); const [searchQuery, setSearchQuery] = useState(''); const [isSearchOpen, setIsSearchOpen] = useState(false); const handleSearchSubmit = (e: React.FormEvent) => { e.preventDefault(); if (searchQuery.trim()) { setIsSearchOpen(true); } }; return ( <> {data?.title ? ( /g, '', ) .replace( /<\/green>/g, '', ), }} /> ) : ( t.rich('title', { green: (chunks) => ( {chunks} ), }) )} {data?.subtitle || t('subtitle')} setSearchQuery(e.target.value)} placeholder="Projekt beschreiben oder Kabel suchen..." className="flex-1 bg-transparent border-none text-white pl-12 pr-2 py-4 placeholder:text-white/50 focus:outline-none text-lg lg:text-xl" /> Fragen trackEvent(AnalyticsEvents.BUTTON_CLICK, { label: data?.ctaLabel || t('cta'), location: 'home_hero_primary', }) } > {data?.ctaLabel || t('cta')} → trackEvent(AnalyticsEvents.BUTTON_CLICK, { label: data?.secondaryCtaLabel || t('exploreProducts'), location: 'home_hero_secondary', }) } > {data?.secondaryCtaLabel || t('exploreProducts')} setIsSearchOpen(false)} initialQuery={searchQuery} triggerSearch={true} /> > ); }
{data?.subtitle || t('subtitle')}