'use strict';

var tslib_es6 = require('../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.js');
var jsxRuntime = require('react/jsx-runtime');
var server = require('next-intl/server');
var server$1 = require('@windrun-huaiin/base-ui/components/server');
var lib = require('@windrun-huaiin/base-ui/lib');
var utils = require('@windrun-huaiin/lib/utils');
var richTextExpert = require('./rich-text-expert.js');
var sectionLayout = require('./section-layout.js');

function Features(_a) {
    return tslib_es6.__awaiter(this, arguments, void 0, function* ({ locale, sectionClassName }) {
        const t = yield server.getTranslations({ locale, namespace: 'features' });
        // Process translation data
        const featureItems = t.raw('items');
        const data = {
            title: t('title'),
            eyesOn: t('eyesOn'),
            description: richTextExpert.richText(t, 'description'),
            items: featureItems.map((feature, index) => ({
                id: `feature-item-${index}`,
                title: feature.title,
                description: richTextExpert.richText(t, `items.${index}.description`),
                iconKey: feature.iconKey
            }))
        };
        return (jsxRuntime.jsxs("section", { id: "features", className: utils.cn(sectionLayout.responsiveSection, sectionClassName), children: [jsxRuntime.jsxs("h2", { className: "text-3xl md:text-4xl font-bold text-center mb-4", children: [data.title, " ", jsxRuntime.jsx("span", { className: lib.themeIconColor, children: data.eyesOn })] }), jsxRuntime.jsx("p", { className: "text-center text-gray-600 dark:text-gray-400 mb-12 text-base sm:text-lg mx-auto max-w-3xl", children: data.description }), jsxRuntime.jsx("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-8 gap-y-12", children: data.items.map((feature) => {
                        const Icon = server$1.getGlobalIcon(feature.iconKey);
                        return (jsxRuntime.jsxs("div", { "data-feature-id": feature.id, className: utils.cn("bg-white dark:bg-gray-800/60 p-8 rounded-xl border border-gray-200 dark:border-gray-700 hover:border-current transition shadow-sm dark:shadow-none", lib.themeIconColor), children: [jsxRuntime.jsx("div", { className: "text-4xl mb-4 flex items-center justify-start", children: jsxRuntime.jsx(Icon, { className: "w-8 h-8" }) }), jsxRuntime.jsx("h3", { className: "text-xl font-semibold mb-3 text-gray-900 dark:text-gray-100", children: feature.title }), jsxRuntime.jsx("p", { className: "text-gray-700 dark:text-gray-300", children: feature.description })] }, feature.id));
                    }) })] }));
    });
}

exports.Features = Features;
