"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.showFaq = showFaq;
exports.showTestimonial = showTestimonial;
const faq_1 = require("../data/faq");
const mainMenu_1 = require("../menus/mainMenu");
async function showFaq(ctx, page) {
    const total = faq_1.faqData.length;
    const i = Math.max(0, Math.min(page, total - 1));
    const item = faq_1.faqData[i];
    const text = `❓ *FAQ — ${i + 1}/${total}*\n\n` +
        `*${item.question}*\n\n` +
        `${item.answer}`;
    try {
        await ctx.deleteMessage();
    }
    catch (_) { }
    await ctx.reply(text, {
        parse_mode: "Markdown",
        reply_markup: (0, mainMenu_1.getFaqNavKeyboard)(i, total),
    });
}
async function showTestimonial(ctx, index) {
    const total = faq_1.testimonials.length;
    const i = Math.max(0, Math.min(index, total - 1));
    const t = faq_1.testimonials[i];
    const stars = "⭐".repeat(t.rating);
    const text = `⭐ *Testimoni Klien — ${i + 1}/${total}*\n\n` +
        `${stars}\n\n` +
        `"${t.text}"\n\n` +
        `— *${t.name}*\n` +
        `🏢 ${t.company}`;
    try {
        await ctx.deleteMessage();
    }
    catch (_) { }
    await ctx.reply(text, {
        parse_mode: "Markdown",
        reply_markup: (0, mainMenu_1.getTestimonialNavKeyboard)(i, total),
    });
}
