'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { ChevronDown } from 'lucide-react';
export function FAQPreview({ data, variant = 'accordion' }) {
    const items = data.items || [];
    const placeholderItems = items.length > 0
        ? items
        : [
            { question: 'What is this?', answer: 'Answer to the first question goes here.' },
            { question: 'How does it work?', answer: 'Answer to the second question goes here.' },
            {
                question: 'Where can I learn more?',
                answer: 'Answer to the third question goes here.',
            },
        ];
    if (variant === 'two-column') {
        const mid = Math.ceil(placeholderItems.length / 2);
        const col1 = placeholderItems.slice(0, mid);
        const col2 = placeholderItems.slice(mid);
        return (_jsx("div", { className: "border-border rounded-md border p-4", children: _jsx("div", { className: "grid grid-cols-2 gap-4", children: [col1, col2].map((column, colIdx) => (_jsx("div", { className: "flex flex-col gap-3", children: column.map((item, i) => (_jsxs("div", { className: "border-border rounded-md border p-3", children: [_jsx("p", { className: "text-foreground text-sm font-medium", children: item.question || 'Question?' }), _jsx("p", { className: "text-muted-foreground mt-1 line-clamp-2 text-xs", children: item.answer || 'Answer text…' })] }, i))) }, colIdx))) }) }));
    }
    if (variant === 'list') {
        return (_jsx("div", { className: "border-border rounded-md border p-4", children: _jsx("div", { className: "flex flex-col gap-3", children: placeholderItems.map((item, i) => (_jsxs("div", { className: "border-border border-b pb-3 last:border-b-0 last:pb-0", children: [_jsx("p", { className: "text-foreground text-sm font-medium", children: item.question || 'Question?' }), _jsx("p", { className: "text-muted-foreground mt-1 line-clamp-2 text-xs", children: item.answer || 'Answer text…' })] }, i))) }) }));
    }
    return (_jsx("div", { className: "border-border rounded-md border p-4", children: _jsx("div", { className: "flex flex-col gap-2", children: placeholderItems.map((item, i) => (_jsxs("div", { className: "border-border rounded-md border p-3", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("p", { className: "text-foreground text-sm font-medium", children: item.question || 'Question?' }), _jsx(ChevronDown, { size: 14, className: "text-muted-foreground shrink-0" })] }), i === 0 && (_jsx("p", { className: "text-muted-foreground mt-2 text-xs", children: item.answer || 'Answer text…' }))] }, i))) }) }));
}
//# sourceMappingURL=FAQPreview.js.map