import { __awaiter } from '../node_modules/.pnpm/@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.mjs';
import { jsxs, jsx } from 'react/jsx-runtime';
import { getTranslations } from 'next-intl/server';
import { globalLucideIcons } from '@windrun-huaiin/base-ui/components/server';
import Link from 'next/link';
import { FooterEmail } from './footer-email.mjs';
import { safeT } from '../lib/t-intl.mjs';
import { cn, getAsNeededLocalizedUrl } from '@windrun-huaiin/lib';
import { themeIconColor } from '@windrun-huaiin/base-ui/lib';

function Footer(_a) {
    return __awaiter(this, arguments, void 0, function* ({ locale, localePrefixAsNeeded = true, defaultLocale = 'en' }) {
        const tFooter = yield getTranslations({ locale, namespace: 'footer' });
        const company = safeT(tFooter, 'company', '');
        const data = {
            terms: safeT(tFooter, 'terms', 'Terms of Service'),
            privacy: safeT(tFooter, 'privacy', 'Privacy Policy'),
            contactUs: safeT(tFooter, 'contactUs', 'Contact Us'),
            email: safeT(tFooter, 'email', ''),
            copyright: tFooter('copyright', { year: new Date().getFullYear(), name: company }),
            clickToCopyText: safeT(tFooter, 'clickToCopy', 'Click to copy'),
            copiedText: safeT(tFooter, 'copied', 'Copied!'),
        };
        return (jsxs("div", { className: "mb-10 w-full mx-auto", children: [jsx("div", { className: cn("w-full border-current border-t", themeIconColor) }), jsx("footer", { children: jsxs("div", { className: "w-full flex flex-col items-center justify-center px-4 py-8 space-y-3", children: [jsxs("div", { className: "flex flex-wrap items-center justify-center gap-x-2 gap-y-2 text-xs sm:text-sm sm:gap-x-6", children: [jsxs(Link, { href: getAsNeededLocalizedUrl(locale, "/legal/terms", localePrefixAsNeeded, defaultLocale), className: "flex items-center space-x-1 hover:underline", children: [jsx(globalLucideIcons.ReceiptText, { className: "h-3.5 w-3.5" }), jsx("span", { children: data.terms })] }), jsxs(Link, { href: getAsNeededLocalizedUrl(locale, "/legal/privacy", localePrefixAsNeeded, defaultLocale), className: "flex items-center space-x-1 hover:underline", children: [jsx(globalLucideIcons.ShieldUser, { className: "h-3.5 w-3.5" }), jsx("span", { children: data.privacy })] }), jsxs(FooterEmail, { email: data.email, clickToCopyText: data.clickToCopyText, copiedText: data.copiedText, children: [jsx(globalLucideIcons.Mail, { className: "h-3.5 w-3.5" }), jsx("span", { children: data.contactUs })] })] }), jsx("div", { className: "text-xs sm:text-sm text-center", children: jsx("span", { children: data.copyright }) })] }) })] }));
    });
}

export { Footer };
