'use client' import React from 'react' import { usePathname } from 'next/navigation' import { MapPin, Phone, Mail, Clock } from 'lucide-react' import type { Page } from '../../payload-types' import { motion } from 'framer-motion' type BaseProps = Extract[0], { blockType: 'contactInfo' }> type Props = BaseProps & { whatsappNumber?: string | null } export const ContactInfoBlock: React.FC = ({ address = 'DO POTWIERDZENIA PRZEZ KLIENTA', phone = '+49 123 456 789', email = 'kontakt@example.com', hours = 'Pon-Pt: 9:00 - 17:00\nPo wcześniejszym umówieniu', }) => { const pathname = usePathname() const localeSegment = pathname?.split('/').filter(Boolean)[0] const isDe = localeSegment === 'de' const isEn = localeSegment === 'en' const t = { contactInfo: isEn ? 'Contact Information' : (isDe ? 'Kontaktinformationen' : 'Dane kontaktowe'), address: isEn ? 'Address' : (isDe ? 'Adresse' : 'Adres'), phone: isEn ? 'Phone' : (isDe ? 'Telefon' : 'Telefon'), email: isEn ? 'Email' : (isDe ? 'E-Mail' : 'E-mail'), hours: isEn ? 'Working Hours' : (isDe ? 'Öffnungszeiten' : 'Godziny pracy'), } return (
{/* Subtelny narożnik (zagięcie kartki) */}

{t.contactInfo}

{address && (

{t.address}

{address}

)} {phone && (

{t.phone}

{phone}
)} {email && (

{t.email}

{email}
)} {hours && (

{t.hours}

{hours}

)}
) }