Files
webb/src/components/sections/FaqSection.tsx
T

102 lines
4.2 KiB
TypeScript
Raw Normal View History

'use client';
import React, { useState } from 'react';
import { ChevronDown, HelpCircle } from 'lucide-react';
import { resolveLocalised } from '@/types';
import { TextAnimate } from '@/components/magicui/text-animate';
interface FaqSectionProps {
title?: any;
items?: Array<{
q: string;
a: string;
}>;
locale?: string;
}
export function FaqSection({
title = 'Frequently Asked Questions',
items = [],
locale = 'en',
}: FaqSectionProps) {
const [openIndex, setOpenIndex] = useState<number | null>(0);
const resolvedTitle = resolveLocalised(title, locale) || 'Frequently Asked Questions';
const defaultItems = [
{
q: 'Do you store or retain uploaded user photos?',
a: 'Never. CRE Innovations enforces a strict Zero-Retention Policy. All photo inferences occur synchronously in volatile GPU memory and the enhanced image is streamed straight back to your browser session. No images are saved on disk or remote servers.',
},
{
q: 'Can I try all tools free on the web without an account?',
a: 'Yes! Every visitor gets 5 free trials each day per tool without registering or providing an email address. For high volume batch editing and unlimited processing, download our native mobile apps.',
},
{
q: 'How does the handoff to the mobile app work?',
a: 'Each tool has a dedicated Home Mobile App. When you want to continue editing on your phone, click "Get the App" or scan the dynamically generated QR code on desktop to jump directly into the app with a 50 free credit welcome bonus.',
},
{
q: 'What image formats and file sizes are supported?',
a: 'We accept JPEG, PNG, and WebP images up to 12MB. The engine performs lossless reconstruction returning studio-quality 4K resolutions.',
},
];
const displayItems = items && items.length > 0 ? items : defaultItems;
return (
<section id="faq" className="py-20 sm:py-28 bg-[#FAF8F5] border-t border-slate-900/[0.06]">
<div className="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8">
<div className="text-center max-w-3xl mx-auto mb-14 space-y-3">
<div className="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">
<HelpCircle className="w-3.5 h-3.5 text-blue-600" />
<span>TRANSPARENCY & ASSURANCE</span>
</div>
<h2 className="text-3xl sm:text-5xl font-display font-extrabold text-slate-900 tracking-tight">
<TextAnimate animation="slideLeft" by="character">
{resolvedTitle}
</TextAnimate>
</h2>
<p className="text-sm sm:text-base text-slate-600 font-sans">
<TextAnimate animation="fadeIn" by="word" delay={0.15}>
Everything you need to know about our browser trial and privacy guarantees.
</TextAnimate>
</p>
</div>
<div className="space-y-4">
{displayItems.map((item, idx) => {
const isOpen = openIndex === idx;
return (
<div
key={idx}
className="rounded-2xl border border-slate-200/90 bg-white overflow-hidden shadow-cream-sm hover:shadow-cream-md transition-all duration-200"
>
<button
type="button"
onClick={() => setOpenIndex(isOpen ? null : idx)}
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"
>
<span className="text-base sm:text-lg font-display">{item.q}</span>
<ChevronDown
className={`w-5 h-5 text-slate-400 shrink-0 transition-transform duration-200 ${
isOpen ? 'rotate-180 text-blue-600' : ''
}`}
/>
</button>
{isOpen && (
<div className="px-6 pb-6 text-sm text-slate-600 leading-relaxed border-t border-slate-100 pt-4 font-sans font-normal animate-fadeIn">
{item.a}
</div>
)}
</div>
);
})}
</div>
</div>
</section>
);
}