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 { richText } from './rich-text-expert.mjs';
import { responsiveSection } from './section-layout.mjs';

function Tips(_a) {
    return __awaiter(this, arguments, void 0, function* ({ locale, sectionClassName }) {
        const t = yield getTranslations({ locale, namespace: 'tips' });
        // Process translation data
        const sections = t.raw('sections');
        const processedSections = sections.map((section, index) => ({
            id: `tip-section-${index}`,
            title: section.title,
            description: richText(t, `sections.${index}.description`)
        }));
        const midPoint = Math.ceil(processedSections.length / 2);
        const leftColumn = processedSections.slice(0, midPoint);
        const rightColumn = processedSections.slice(midPoint);
        const data = {
            title: t('title'),
            eyesOn: t('eyesOn'),
            leftColumn,
            rightColumn
        };
        return (jsxs("section", { id: "tips", className: cn(responsiveSection, sectionClassName), children: [jsxs("h2", { className: "text-3xl md:text-4xl font-bold text-center mb-16", children: [data.title, " ", jsx("span", { className: "text-purple-500", children: data.eyesOn })] }), jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-12 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: [data.leftColumn, data.rightColumn].map((column, colIndex) => (jsx("div", { className: "space-y-8", children: column.map((tip) => (jsxs("div", { "data-tip-id": tip.id, className: "space-y-4", children: [jsx("h3", { className: "text-2xl font-semibold", children: tip.title }), jsx("p", { className: "", children: tip.description })] }, tip.id))) }, colIndex))) })] }));
    });
}

export { Tips };
