2026-11-03 12:24:43 +05:30
'use client' ;
import React , { useState } from 'react' ;
2026-11-06 10:53:55 +05:30
import { ChevronDown } from 'lucide-react' ;
2026-11-03 12:24:43 +05:30
import { resolveLocalised } from '@/types' ;
2026-11-06 18:38:45 +05:30
import { KineticText } from '@/components/magicui/kinetic-text' ;
2026-11-03 12:24:43 +05:30
interface FaqSectionProps {
title? : any ;
items? : Array < {
q : string ;
a : string ;
} > ;
locale? : string ;
}
export function FaqSection ({
2026-11-06 10:53:55 +05:30
title = 'Frequently asked questions' ,
2026-11-03 12:24:43 +05:30
items = [],
locale = 'en' ,
} : FaqSectionProps ) {
const [ openIndex , setOpenIndex ] = useState < number | null >( 0 );
2026-11-06 10:53:55 +05:30
const resolvedTitle = resolveLocalised ( title , locale ) || 'Frequently asked questions' ;
2026-11-03 12:24:43 +05:30
2026-11-04 17:55:18 +05:30
const defaultItems = [
{
q : 'Do you store or retain uploaded user photos?' ,
2026-11-06 10:53:55 +05:30
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.' ,
2026-11-04 17:55:18 +05:30
},
{
q : 'Can I try all tools free on the web without an account?' ,
2026-11-06 10:53:55 +05:30
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.' ,
2026-11-04 17:55:18 +05:30
},
{
q : 'How does the handoff to the mobile app work?' ,
2026-11-06 10:53:55 +05:30
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.' ,
2026-11-04 17:55:18 +05:30
},
{
q : 'What image formats and file sizes are supported?' ,
2026-11-06 10:53:55 +05:30
a : 'We accept JPEG, PNG, and WebP images up to 12MB. The engine performs lossless reconstruction returning studio-quality resolutions.' ,
2026-11-04 17:55:18 +05:30
},
];
const displayItems = items && items . length > 0 ? items : defaultItems ;
2026-11-03 12:24:43 +05:30
return (
2026-11-06 10:53:55 +05:30
< section id = "faq" className = "py-16 sm:py-24 bg-paper border-b border-rule relative" >
< div className = "max-w-3xl mx-auto px-4 sm:px-6 lg:px-8 space-y-10" >
{ /* Section Header */ }
< div className = "space-y-2 border-b border-rule pb-5" >
< h2 className = "text-3xl sm:text-4xl font-display font-bold text-ink tracking-tight" >
2026-11-06 18:38:45 +05:30
< KineticText >{ resolvedTitle }</ KineticText >
2026-11-04 17:55:18 +05:30
</ h2 >
2026-11-06 10:53:55 +05:30
< p className = "text-sm sm:text-base text-ink-2 font-body text-pretty" >
Technical details regarding zero - storage privacy , format limits , and mobile client handoff .
2026-11-04 17:55:18 +05:30
</ p >
2026-11-03 13:16:16 +05:30
</ div >
2026-11-03 12:24:43 +05:30
2026-11-06 18:38:45 +05:30
{ /* Rounded Accordion Cards (NO SHARP EDGES) */ }
< div className = "space-y-3.5" >
2026-11-04 17:55:18 +05:30
{ displayItems . map (( item , idx ) => {
2026-11-03 12:24:43 +05:30
const isOpen = openIndex === idx ;
return (
2026-11-06 18:38:45 +05:30
< div
key = { idx }
className = { `rounded-2xl bg-paper-hi border shadow-xs transition-[border-color,box-shadow] duration-200 overflow-hidden ${
isOpen ? 'border-accent shadow-glow' : 'border-rule hover:border-accent/50'
} ` }
>
2026-11-03 12:24:43 +05:30
< button
2026-11-04 17:55:18 +05:30
type = "button"
2026-11-03 12:24:43 +05:30
onClick = {() => setOpenIndex ( isOpen ? null : idx )}
2026-11-06 18:38:45 +05:30
className = "w-full text-left p-5 flex items-center justify-between gap-4 font-body font-bold text-base text-ink hover:text-accent transition-colors focus-visible:ring-2 focus-visible:ring-accent active:bg-paper-2"
2026-11-06 10:53:55 +05:30
aria-expanded = { isOpen }
2026-11-03 12:24:43 +05:30
>
2026-11-06 10:53:55 +05:30
< span >{ item . q }</ span >
2026-11-06 18:38:45 +05:30
< div className = { `w-8 h-8 rounded-full bg-paper-2 flex items-center justify-center shrink-0 transition-transform duration-200 ${
isOpen ? 'rotate-180 bg-accent text-white' : 'text-muted'
} ` }>
< ChevronDown className = "w-4 h-4" aria-hidden = "true" />
</ div >
2026-11-03 12:24:43 +05:30
</ button >
{ isOpen && (
2026-11-06 18:38:45 +05:30
< div className = "px-5 pb-5 pt-1 text-sm text-ink-2 leading-relaxed font-body border-t border-rule/60" >
2026-11-03 12:24:43 +05:30
{ item . a }
</ div >
)}
</ div >
);
})}
</ div >
</ div >
</ section >
);
}