import Link from 'next/link';
import Image from 'next/image';

interface CompanyInfo {
  contactEmail: string;
  contactPhone: string;
  address: string;
}

interface FooterProps {
  companyInfo?: CompanyInfo;
}

export function Footer({ companyInfo }: FooterProps) {
  return (
    <footer className="bg-neutral-dark text-neutral-light py-16">
      <div className="container grid grid-cols-1 md:grid-cols-4 gap-12">
        <div className="col-span-1 md:col-span-2">
          <Link href="/" className="relative block h-14 w-56 mb-6">
            <Image
              src="/assets/logo-white.png"
              alt="E-TIB Gruppe"
              fill
              className="object-contain object-left"
            />
          </Link>
          <p className="text-text-light max-w-sm mb-6">
            Die Experten für Kabeltiefbau, Horizontalspülbohrungen, komplexe Querungen und umfassende Infrastrukturprojekte.
          </p>
          {companyInfo && (
            <div className="text-text-light text-sm space-y-2 mt-6 border-t border-white/10 pt-6 max-w-xs">
              <p className="whitespace-pre-line">{companyInfo.address}</p>
              <p>Email: <a href={`mailto:${companyInfo.contactEmail}`} className="hover:text-white">{companyInfo.contactEmail}</a></p>
              <p>Tel: <a href={`tel:${companyInfo.contactPhone.replace(/\\s+/g, '')}`} className="hover:text-white">{companyInfo.contactPhone}</a></p>
            </div>
          )}
        </div>
        <div>
          <h4 className="font-heading font-semibold text-lg mb-4">Unternehmen</h4>
          <ul className="space-y-2">
            <li><Link href="/kompetenzen" className="text-text-light hover:text-primary-light transition-colors">Kompetenzen</Link></li>
            <li><Link href="/ueber-uns" className="text-text-light hover:text-primary-light transition-colors">Über uns</Link></li>
            <li><Link href="/karriere" className="text-text-light hover:text-primary-light transition-colors">Karriere / Jobs</Link></li>
            <li><Link href="/kontakt" className="text-text-light hover:text-primary-light transition-colors">Kontakt</Link></li>
          </ul>
        </div>
        <div>
          <h4 className="font-heading font-semibold text-lg mb-4">Rechtliches</h4>
          <ul className="space-y-2">
            <li><Link href="/impressum" className="text-text-light hover:text-primary-light transition-colors">Impressum</Link></li>
            <li><Link href="/datenschutz" className="text-text-light hover:text-primary-light transition-colors">Datenschutz</Link></li>
            <li><button className="text-text-light hover:text-primary-light transition-colors">Cookie-Einstellungen</button></li>
          </ul>
        </div>
      </div>
      <div className="container mt-12 pt-8 border-t border-neutral-dark/40 border-t-white/10 text-center text-text-light text-sm">
        <p>&copy; {new Date().getFullYear()} E-TIB GmbH. Alle Rechte vorbehalten.</p>
      </div>
    </footer>
  );
}
