'use client'

import { useLang } from '@/context/LangContext'
import { siteConfig } from '@/lib/site'

const CONTENT = {
  de: {
    title: 'Impressum',
    companyLabel: 'Unternehmen',
    addressLabel: 'Adresse',
    representativeLabel: 'Vertretungsberechtigt',
    contactLabel: 'Kontakt',
    registryLabel: 'Register',
    vatLabel: 'USt-ID',
    note: 'Vor der Veroeffentlichung muessen alle rechtlichen Angaben mit den echten Firmendaten ersetzt werden.',
  },
  en: {
    title: 'Imprint',
    companyLabel: 'Company',
    addressLabel: 'Address',
    representativeLabel: 'Represented by',
    contactLabel: 'Contact',
    registryLabel: 'Registry',
    vatLabel: 'VAT ID',
    note: 'Replace all legal placeholders with your real company details before publishing the site.',
  },
  es: {
    title: 'Aviso Legal',
    companyLabel: 'Empresa',
    addressLabel: 'Direccion',
    representativeLabel: 'Representante',
    contactLabel: 'Contacto',
    registryLabel: 'Registro',
    vatLabel: 'IVA',
    note: 'Sustituye todos los marcadores legales por tus datos reales antes de publicar el sitio.',
  },
}

export default function ImprintPage() {
  const { lang } = useLang()
  const c = CONTENT[lang]

  return (
    <main className="container" style={{ paddingTop: '8rem', paddingBottom: '8rem', maxWidth: '800px' }}>
      <h1>{c.title}</h1>
      <div style={{ marginTop: '2rem', lineHeight: '1.8', opacity: 0.9 }}>
        <p>
          <strong>{c.companyLabel}:</strong> {siteConfig.company.legalName}
        </p>
        <p>
          <strong>{c.addressLabel}:</strong> {siteConfig.company.addressLine1}
        </p>
        {siteConfig.company.addressLine2 ? <p>{siteConfig.company.addressLine2}</p> : null}
        <p>{siteConfig.company.country}</p>
        <p>
          <strong>{c.representativeLabel}:</strong> {siteConfig.company.representative}
        </p>
        <p>
          <strong>{c.contactLabel}:</strong> <a href={`mailto:${siteConfig.legalEmail}`}>{siteConfig.legalEmail}</a>
        </p>
        <p>
          <strong>{c.registryLabel}:</strong> {siteConfig.company.registry}
        </p>
        <p>
          <strong>{c.vatLabel}:</strong> {siteConfig.company.vatId}
        </p>
        <p style={{ marginTop: '1rem', fontSize: '0.95rem', opacity: 0.8 }}>{c.note}</p>
      </div>
    </main>
  )
}
