From 297c54ee9d71d621d6fac871eda63c6f48b8e12f Mon Sep 17 00:00:00 2001 From: huazhuang80-star <295584745+huazhuang80-star@users.noreply.github.com> Date: Sun, 21 Jun 2026 23:07:36 +0800 Subject: [PATCH] Improve FAQ accordion accessibility --- components/landing/faq.tsx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/components/landing/faq.tsx b/components/landing/faq.tsx index 1a27570..19eee57 100644 --- a/components/landing/faq.tsx +++ b/components/landing/faq.tsx @@ -1,6 +1,6 @@ "use client"; -import { useState } from "react"; +import { useId, useState } from "react"; import { ChevronDown } from "lucide-react"; import { Reveal } from "@/components/landing/reveal"; import { SectionLabel } from "@/components/landing/section-label"; @@ -9,6 +9,7 @@ import { FAQ_CATEGORIES, FAQ_ITEMS, type FaqCategory } from "@/lib/faq"; import { cn } from "@/lib/utils"; export function Faq() { + const faqIdPrefix = useId(); const [category, setCategory] = useState("about"); const [openIndex, setOpenIndex] = useState(0); @@ -37,9 +38,10 @@ export function Faq() {