Audit fixes: VIP self-grant, draft leak, onboarding flag, hero personalization, gated downloads
Deploy GitHub Pages / deploy (push) Canceled after 0s
Deploy GitHub Pages / deploy (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
'use client'
|
||||
|
||||
import { useState } from 'react'
|
||||
|
||||
/* FAQ accordions — port of the subscription page's faq-button toggle. */
|
||||
export default function Faq({ items }: { items: { q: string; a: string }[] }) {
|
||||
const [openIdx, setOpenIdx] = useState<number | null>(0)
|
||||
|
||||
return (
|
||||
<div className="faq-list">
|
||||
{items.map((item, i) => {
|
||||
const open = openIdx === i
|
||||
return (
|
||||
<article className={`faq-item${open ? ' open' : ''}`} key={i}>
|
||||
<button
|
||||
className="faq-button"
|
||||
type="button"
|
||||
aria-expanded={open}
|
||||
onClick={() => setOpenIdx(open ? null : i)}
|
||||
>
|
||||
<span>{item.q}</span><span aria-hidden="true">{open ? '−' : '+'}</span>
|
||||
</button>
|
||||
<div className="faq-answer" hidden={!open}>{item.a}</div>
|
||||
</article>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user