'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 utils = require('@windrun-huaiin/lib/utils');
var richTextExpert = require('./rich-text-expert.js');
var sectionLayout = require('./section-layout.js');

function Tips(_a) {
    return tslib_es6.__awaiter(this, arguments, void 0, function* ({ locale, sectionClassName }) {
        const t = yield server.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: richTextExpert.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 (jsxRuntime.jsxs("section", { id: "tips", className: utils.cn(sectionLayout.responsiveSection, sectionClassName), children: [jsxRuntime.jsxs("h2", { className: "text-3xl md:text-4xl font-bold text-center mb-16", children: [data.title, " ", jsxRuntime.jsx("span", { className: "text-purple-500", children: data.eyesOn })] }), jsxRuntime.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) => (jsxRuntime.jsx("div", { className: "space-y-8", children: column.map((tip) => (jsxRuntime.jsxs("div", { "data-tip-id": tip.id, className: "space-y-4", children: [jsxRuntime.jsx("h3", { className: "text-2xl font-semibold", children: tip.title }), jsxRuntime.jsx("p", { className: "", children: tip.description })] }, tip.id))) }, colIndex))) })] }));
    });
}

exports.Tips = Tips;
