'use client'; import * as React from 'react'; import { motion, Variants } from 'framer-motion'; import Image from 'next/image'; import Link from 'next/link'; import { HoverShineOverlay } from '@/components/ui/HoverShineOverlay'; import { AnimatedGlossyBorder } from '@/components/ui/AnimatedGlossyBorder'; interface SubCompanyTilesProps { badge?: string; title?: string; companies?: { title?: string; url?: string; backgroundImage?: string; }[]; data?: any; } const defaultCompanies = [ { title: 'E-TIB GmbH', backgroundImage: '/assets/photos/DJI_0243.JPG', }, { title: 'E-TIB Ingenieurgesellschaft mbH', url: 'https://www.etib-ing.com/', backgroundImage: '/assets/photos/DSC01137.JPG', }, { title: 'NEMO GmbH', url: 'https://www.nemo-gmbh.de/', backgroundImage: '/assets/photos/DJI_0048.JPG', } ]; const containerVariants: Variants = { hidden: { opacity: 0 }, visible: { opacity: 1, transition: { staggerChildren: 0.15, }, }, }; const itemVariants: Variants = { hidden: { opacity: 0, y: 30 }, visible: { opacity: 1, y: 0, transition: { duration: 0.8, ease: [0.16, 1, 0.3, 1] } }, }; import { usePathname } from 'next/navigation'; import { LogoArcs } from '@/components/ui/LogoArcs'; export function SubCompanyTiles(props: SubCompanyTilesProps) { const { data } = props; const badge = props.badge || data?.badge; const title = props.title || data?.title; const rawCompanies = props.companies || data?.companies; const pathname = usePathname(); const isDe = pathname?.startsWith('/de') ?? true; const companiesData = rawCompanies?.map((c: any) => ({ title: c.title, url: c.url, backgroundImage: c.backgroundImage?.url || c.backgroundImage || '/assets/photos/DJI_0243.JPG', })) || defaultCompanies; return (
{(badge || title) && (
{badge &&

{badge}

} {title &&

{title}

}
)}
{companiesData.map((company: any, index: number) => { const isCurrent = company.title.toUpperCase() === 'E-TIB GMBH'; const hasUrl = !!company.url; const isExternal = hasUrl && company.url.startsWith('http'); const CardWrapper = hasUrl ? (isExternal ? 'a' : Link) : 'div'; const wrapperProps = hasUrl ? (isExternal ? { href: company.url, target: "_blank", rel: "noopener noreferrer" } : { href: company.url }) : {}; // Generate logo representation based on title const isEtib = company.title.includes('E-TIB'); const isIng = company.title.includes('Ingenieur'); const isVerwaltung = company.title.includes('Verwaltung'); const isBohrtechnik = company.title.includes('Bohrtechnik'); const isNemo = company.title.includes('NEMO'); const bgPositionClasses = [ "-bottom-[30%] -right-[30%]", "-top-[30%] -left-[30%]", "-bottom-[30%] -left-[30%]", "-top-[30%] -right-[30%]" ]; const animationClasses = [ "animate-[spin_60s_linear_infinite]", "animate-[spin_80s_linear_infinite]", "animate-[spin_100s_linear_infinite]", "animate-[spin_120s_linear_infinite]" ]; const positionClass = bgPositionClasses[index % bgPositionClasses.length]; const animationClass = animationClasses[index % animationClasses.length]; const CardContent = ( <>
Background
{/* Heavy dark gradient overlay to make logos pop */}
{/* Subtle Background Logo Arcs */}
{/* Premium Shine Sweep Effect (Industrial Reflection) */} {/* Glossy Animated Border */} {/* Current Site Indicator Badge */} {isCurrent && (
{isDe ? 'Aktuell hier' : 'You are here'}
)}
{/* LOGO RENDERING */} {isEtib ? (
E-TIB Logo
{isIng && (
Ingenieurgesellschaft
)} {isVerwaltung && (
Verwaltung GmbH
)} {isBohrtechnik && (
Bohrtechnik GmbH
)}
) : isNemo ? (
NEMO
GmbH
) : (
{company.title}
)}
{/* Subtle Link Indicator */} {company.url && (
{isExternal ? (isDe ? 'Website Besuchen' : 'Visit Website') : (isDe ? 'Zum Standort' : 'View Location')}
)} ); const sharedClass = `group relative overflow-hidden aspect-[4/3] flex flex-col justify-center items-center shadow-xl transition-all duration-500 bg-neutral-dark block w-full h-full sm:rounded-xl select-none ${ isCurrent ? 'border border-white/5 hover:shadow-2xl hover:-translate-y-1 hover:border-white/10 cursor-pointer' : 'border border-white/5 hover:shadow-2xl hover:-translate-y-1 hover:border-white/10 cursor-pointer' }`; return ( {hasUrl ? ( isExternal ? ( {CardContent} ) : ( {CardContent} ) ) : (
{CardContent}
)}
); })}
); }