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 { cn } from '@windrun-huaiin/lib/utils';
import { getGlobalIcon } from '@windrun-huaiin/base-ui/components/server';
import { richText } from './rich-text-expert.mjs';
import { responsiveSection } from './section-layout.mjs';

function Usage(_a) {
    return __awaiter(this, arguments, void 0, function* ({ locale, sectionClassName }) {
        const t = yield getTranslations({ locale, namespace: 'usage' });
        // Process translation data
        const steps = t.raw('steps');
        const data = {
            title: t('title'),
            eyesOn: t('eyesOn'),
            description: richText(t, 'description'),
            steps: steps.map((step, index) => ({
                id: `usage-step-${index}`,
                title: step.title,
                description: richText(t, `steps.${index}.description`),
                iconKey: step.iconKey,
                stepNumber: index + 1
            }))
        };
        return (jsxs("section", { id: "usage", className: cn(responsiveSection, sectionClassName), children: [jsxs("h2", { className: "text-3xl md:text-4xl font-bold text-center mb-4", children: [data.title, " ", jsx("span", { className: "text-purple-500", children: data.eyesOn })] }), 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 }), jsx("div", { className: "bg-gray-50 dark:bg-gray-800/60 border border-gray-200 dark:border-gray-700 rounded-2xl p-8 md:p-12 shadow-sm dark:shadow-none", children: jsx("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-8 gap-y-12", children: data.steps.map((step) => {
                            const Icon = getGlobalIcon(step.iconKey);
                            return (jsxs("div", { "data-usage-step": step.id, className: "flex items-start", children: [jsx("div", { className: "shrink-0 mr-4", children: jsx(Icon, { className: "w-8 h-8 text-purple-500" }) }), jsxs("div", { children: [jsx("h3", { className: "text-xl font-semibold mb-3 text-gray-900 dark:text-gray-100 flex items-center", children: `${step.stepNumber}. ${step.title}` }), jsx("p", { className: "text-gray-700 dark:text-gray-300", children: step.description })] })] }, step.id));
                        }) }) })] }));
    });
}

export { Usage };
