import {MapPin, Phone} from 'lucide-react';
import type {Locale} from '@/lib/catalog';
import {PLANCK_ADDRESS, PLANCK_PHONE, PLANCK_PHONE_HREF, PLANCK_POSTAL_CODE, contactDigits} from '@/lib/planck-contact';

export function ContactDetails({locale, showPhone = true}: {locale: Locale; showPhone?: boolean}) {
  const phoneLabel = locale === 'en' ? 'Phone' : locale === 'ar' ? 'الهاتف' : 'تلفن';
  const addressLabel = locale === 'en' ? 'Address' : locale === 'ar' ? 'العنوان' : 'نشانی';
  const postalLabel = locale === 'en' ? 'Postal code' : locale === 'ar' ? 'الرمز البريدي' : 'کد پستی';
  return <address className="planck-contact-details">
    {showPhone && <a className="planck-contact-phone" href={PLANCK_PHONE_HREF}><Phone size={18} aria-hidden="true"/><span>{phoneLabel}: <bdi>{contactDigits(PLANCK_PHONE, locale)}</bdi></span></a>}
    <div className="planck-contact-address"><MapPin size={18} aria-hidden="true"/><div><p><strong>{addressLabel}: </strong>{PLANCK_ADDRESS[locale]}</p><p className="planck-contact-postal">{postalLabel}: <bdi>{contactDigits(PLANCK_POSTAL_CODE, locale)}</bdi></p></div></div>
  </address>;
}
