2026-11-03 12:24:43 +05:30
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
import React, { useState } from 'react';
|
2026-11-03 13:16:16 +05:30
|
|
|
import { ChevronDown, HelpCircle } from 'lucide-react';
|
2026-11-03 12:24:43 +05:30
|
|
|
import { resolveLocalised } from '@/types';
|
|
|
|
|
|
|
|
|
|
interface FaqSectionProps {
|
|
|
|
|
title?: any;
|
|
|
|
|
items?: Array<{
|
|
|
|
|
q: string;
|
|
|
|
|
a: string;
|
|
|
|
|
}>;
|
|
|
|
|
locale?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function FaqSection({
|
|
|
|
|
title,
|
|
|
|
|
items = [],
|
|
|
|
|
locale = 'en',
|
|
|
|
|
}: FaqSectionProps) {
|
|
|
|
|
const [openIndex, setOpenIndex] = useState<number | null>(0);
|
|
|
|
|
|
|
|
|
|
if (!items || items.length === 0) return null;
|
|
|
|
|
|
|
|
|
|
return (
|
2026-11-03 13:16:16 +05:30
|
|
|
<section className="py-24 sm:py-32 bg-[#FAF8F5] border-t border-slate-900/[0.08]">
|
2026-11-03 12:24:43 +05:30
|
|
|
<div className="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8">
|
2026-11-03 17:08:23 +05:30
|
|
|
<div className="text-center max-w-3xl mx-auto mb-16 space-y-3 preserve-3d">
|
|
|
|
|
<div className="badge-3d inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full bg-blue-50 border border-blue-200 text-xs font-mono font-semibold text-blue-700">
|
2026-11-03 13:16:16 +05:30
|
|
|
<HelpCircle className="w-3.5 h-3.5 text-blue-600" />
|
|
|
|
|
<span>TRANSPARENCY & ASSURANCE</span>
|
|
|
|
|
</div>
|
|
|
|
|
{title && (
|
2026-11-03 17:08:23 +05:30
|
|
|
<h2 className="text-3xl sm:text-4xl lg:text-5xl font-display font-black text-slate-900 tracking-tight text-3d-chiseled">
|
2026-11-03 13:16:16 +05:30
|
|
|
{resolveLocalised(title, locale)}
|
|
|
|
|
</h2>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
2026-11-03 12:24:43 +05:30
|
|
|
|
2026-11-03 13:16:16 +05:30
|
|
|
<div className="space-y-4">
|
2026-11-03 12:24:43 +05:30
|
|
|
{items.map((item, idx) => {
|
|
|
|
|
const isOpen = openIndex === idx;
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
key={idx}
|
2026-11-03 13:16:16 +05:30
|
|
|
className="rounded-2xl border border-slate-900/[0.08] bg-white overflow-hidden shadow-cream-sm hover:shadow-cream-md transition-all"
|
2026-11-03 12:24:43 +05:30
|
|
|
>
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => setOpenIndex(isOpen ? null : idx)}
|
2026-11-03 13:16:16 +05:30
|
|
|
className="w-full p-6 text-left flex items-center justify-between gap-4 font-bold text-slate-900 hover:text-blue-600 transition-colors"
|
2026-11-03 12:24:43 +05:30
|
|
|
>
|
2026-11-03 17:08:23 +05:30
|
|
|
<span className="text-base sm:text-lg font-display text-3d-chiseled">{item.q}</span>
|
2026-11-03 12:24:43 +05:30
|
|
|
<ChevronDown
|
|
|
|
|
className={`w-5 h-5 text-slate-400 shrink-0 transition-transform duration-200 ${
|
|
|
|
|
isOpen ? 'rotate-180 text-blue-600' : ''
|
|
|
|
|
}`}
|
|
|
|
|
/>
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
{isOpen && (
|
2026-11-03 13:16:16 +05:30
|
|
|
<div className="px-6 pb-6 text-sm text-slate-600 leading-relaxed border-t border-slate-100 pt-4 font-normal">
|
2026-11-03 12:24:43 +05:30
|
|
|
{item.a}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
);
|
|
|
|
|
}
|