import { __awaiter, __rest } 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 { jsx } from 'react/jsx-runtime';
import { getTranslations } from 'next-intl/server';
import { cn } from '@windrun-huaiin/lib/utils';

function SiteX(_a) {
    return __awaiter(this, void 0, void 0, function* () {
        var { locale, type, namespace, tKey, className } = _a, props = __rest(_a, ["locale", "type", "namespace", "tKey", "className"]);
        // 默认命名空间和key
        let ns = namespace;
        let key = tKey;
        if (!ns) {
            ns = type === 'site' ? 'home' : 'footer';
        }
        if (!key) {
            key = type === 'site' ? 'title' : 'email';
        }
        const t = yield getTranslations({ locale, namespace: ns });
        const text = t(key, { defaultValue: type === 'site' ? 'Site----' : '----@example.com' });
        if (type === 'site') {
            return (jsx("strong", Object.assign({}, props, { className: cn('font-extrabold text-sm', className), children: text })));
        }
        if (type === 'email') {
            return (jsx("a", Object.assign({}, props, { href: `mailto:${text}`, className: cn('font-mono underline text-sm', className), children: text })));
        }
        return null;
    });
}

export { SiteX };
