import Link from "next/link";
import type { CompanyInformation } from '../../types/api/company-information';
import type { SiteConfig } from '../../types/config';

interface FooterHomeProps {
    config?: SiteConfig;
    companyInformation?: CompanyInformation | null;
}

const COLUMN_TITLES = ['Home', 'Services', 'Locations', 'About Us'];

export const FooterHome = ({
    config,
    companyInformation,
}: FooterHomeProps) => {
    const currentYear = new Date().getFullYear();
    
    // Get footer navigation from config
    const footerColumns = config?.navigation?.footer || [];
    
    const companyName = companyInformation?.company_name || '';

    return (
        <footer className="bg-primary border-t border-secondary py-12 md:py-16">
            <div className="mx-auto max-w-container px-4 md:px-8">
                <div className="grid grid-cols-1 gap-12 md:grid-cols-4">
                    {footerColumns.map((column, i) => (
                        <div key={i}>
                            <h4 className="font-body text-sm font-medium uppercase tracking-wide text-fg-primary mb-4">
                                {COLUMN_TITLES[i] || `Column ${i + 1}`}
                            </h4>
                            <ul className="space-y-2">
                                {column.map((link, j) => (
                                    <li key={j}>
                                        <Link
                                            href={link.href}
                                            className="font-body text-sm text-tertiary hover:underline"
                                        >
                                            {link.label}
                                        </Link>
                                    </li>
                                ))}
                            </ul>
                        </div>
                    ))}
                </div>
                
                <div className="mt-12 pt-8 border-t border-secondary text-center">
                    <p className="font-body text-sm text-tertiary">
                        © {currentYear} {companyName || 'Company Name'}. All rights reserved.
                    </p>
                </div>
            </div>
        </footer>
    );
};

import { registerThemeVariant } from '../../lib/component-registry';
registerThemeVariant('footer-home', 'aman', FooterHome);
