{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "faqs-block-two",
  "type": "registry:block",
  "title": "FAQs Block Two",
  "description": "A FAQs Block component for displaying frequently asked questions.",
  "files": [
    {
      "path": "src/registry/blocks/faq-block-two.tsx",
      "type": "registry:block",
      "content": "\"use client\";\n\nimport { useId, useMemo, useState, type ComponentProps } from \"react\";\nimport { Search } from \"lucide-react\";\n\nimport {\n  Accordion,\n  AccordionContent,\n  AccordionItem,\n  AccordionTrigger,\n} from \"@/components/ui/accordion\";\nimport { Input } from \"@/components/ui/input\";\nimport { cn } from \"@/lib/utils\";\n\nexport type FAQGroup = {\n  label: string;\n  items: { question: string; answer: string }[];\n};\n\nexport type FAQBlockTwoProps = {\n  title?: string;\n  description?: string;\n  searchPlaceholder?: string;\n  groups?: FAQGroup[];\n} & ComponentProps<\"section\">;\n\nconst DEFAULT_GROUPS: FAQGroup[] = [\n  {\n    label: \"Billing\",\n    items: [\n      {\n        question: \"Who counts as a paid seat?\",\n        answer:\n          \"Anyone who builds or edits rotas. Staff who only view their shifts, swap with colleagues or clock in are free. A café with two managers and 30 staff pays for two seats.\",\n      },\n      {\n        question: \"Can I pay yearly by bank transfer?\",\n        answer:\n          \"Yes, on any plan with five or more seats. Choose Annual → Invoice in Billing and we'll send a PDF with our IBAN. You have 30 days to pay; the account stays fully active meanwhile.\",\n      },\n      {\n        question: \"What happens to my bill if I add someone mid-month?\",\n        answer:\n          \"We charge for the remaining days only, on your next invoice. Removing a seat gives a credit the same way. You'll never see a surprise charge between invoices.\",\n      },\n    ],\n  },\n  {\n    label: \"Account\",\n    items: [\n      {\n        question: \"Can one login manage several locations?\",\n        answer:\n          \"Yes. Add each site under Settings → Locations. Managers can be limited to one site or see all of them, and staff can be shared across sites without duplicate profiles.\",\n      },\n      {\n        question: \"How do I hand the account over to someone else?\",\n        answer:\n          \"The current owner opens Settings → Ownership and picks another admin. They get an email to confirm; until they do, nothing changes. Billing details move with the account.\",\n      },\n      {\n        question: \"Do you support single sign-on?\",\n        answer:\n          \"SAML and Google Workspace SSO are included on the Business plan. Okta and Entra ID are tested; any SAML 2.0 provider should work. SCIM provisioning is on the roadmap for Q1.\",\n      },\n    ],\n  },\n  {\n    label: \"Product\",\n    items: [\n      {\n        question: \"Does Fernway warn me about rest-period breaches?\",\n        answer:\n          \"Yes. Set the minimum rest between shifts (11 hours by default) and the maximum weekly hours for each contract type. Shifts that break a rule are flagged in amber before you publish, not after.\",\n      },\n      {\n        question: \"Can staff see the rota without installing the app?\",\n        answer:\n          \"Every published rota has a private link per person that opens in any browser. They can also subscribe to it in Google or Apple Calendar, and changes appear within 15 minutes.\",\n      },\n      {\n        question: \"Can I export timesheets to payroll?\",\n        answer:\n          \"Approved timesheets export as CSV, or sync directly to Xero, Sage and BrightPay. Breaks, overtime and holiday hours land in separate columns so nothing needs retyping.\",\n      },\n    ],\n  },\n];\n\nexport function FAQBlockTwo({\n  title = \"Help centre, the short version\",\n  description = \"The questions we answer most often, grouped by where they come up. Search across all of them.\",\n  searchPlaceholder = \"Try “SSO” or “timesheets”\",\n  groups = DEFAULT_GROUPS,\n  className,\n  ...props\n}: FAQBlockTwoProps) {\n  const [query, setQuery] = useState(\"\");\n  const id = useId();\n  const searchId = `${id}-search`;\n  const titleId = `${id}-title`;\n\n  const filtered = useMemo(() => {\n    const needle = query.trim().toLowerCase();\n    if (!needle) return groups;\n    return groups\n      .map((group) => ({\n        ...group,\n        items: group.items.filter((item) =>\n          `${item.question} ${item.answer}`.toLowerCase().includes(needle),\n        ),\n      }))\n      .filter((group) => group.items.length > 0);\n  }, [groups, query]);\n\n  const total = groups.reduce((sum, group) => sum + group.items.length, 0);\n  const matches = filtered.reduce((sum, group) => sum + group.items.length, 0);\n\n  return (\n    <section\n      data-slot=\"faq-block-two\"\n      aria-labelledby={titleId}\n      className={cn(\"bg-background text-foreground w-full\", className)}\n      {...props}\n    >\n      <div className=\"mx-auto max-w-6xl px-6 py-20 md:py-28\">\n        <div className=\"grid gap-8 border-b pb-10 md:grid-cols-12 md:items-end\">\n          <div className=\"md:col-span-7\">\n            <h2\n              id={titleId}\n              className=\"text-3xl font-semibold tracking-tight text-balance md:text-5xl\"\n            >\n              {title}\n            </h2>\n            <p className=\"text-muted-foreground mt-4 max-w-md text-sm leading-relaxed\">\n              {description}\n            </p>\n          </div>\n          <div className=\"md:col-span-5\">\n            <label\n              htmlFor={searchId}\n              className=\"text-muted-foreground font-mono text-xs tracking-wider uppercase\"\n            >\n              Search questions\n            </label>\n            <div className=\"relative mt-2\">\n              <Search\n                aria-hidden=\"true\"\n                className=\"text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2\"\n              />\n              <Input\n                id={searchId}\n                type=\"search\"\n                value={query}\n                onChange={(event) => setQuery(event.target.value)}\n                placeholder={searchPlaceholder}\n                autoComplete=\"off\"\n                className=\"pl-9\"\n              />\n            </div>\n            <p\n              aria-live=\"polite\"\n              className=\"text-muted-foreground mt-2 font-mono text-[11px] tracking-wider uppercase tabular-nums\"\n            >\n              {query.trim()\n                ? `${matches} of ${total} questions`\n                : `${total} questions`}\n            </p>\n          </div>\n        </div>\n\n        {filtered.length === 0 ? (\n          <div className=\"grid gap-4 py-16 md:grid-cols-12\">\n            <p className=\"text-muted-foreground font-mono text-xs tracking-wider uppercase md:col-span-3\">\n              No match\n            </p>\n            <div className=\"md:col-span-9\">\n              <p className=\"text-lg font-medium tracking-tight\">\n                Nothing here mentions “{query.trim()}”.\n              </p>\n              <p className=\"text-muted-foreground mt-2 max-w-prose text-sm leading-relaxed\">\n                Try a shorter word, or{\" \"}\n                <button\n                  type=\"button\"\n                  onClick={() => setQuery(\"\")}\n                  className=\"text-foreground decoration-primary rounded-sm underline underline-offset-4 outline-none hover:decoration-2 focus-visible:ring-2 focus-visible:ring-ring\"\n                >\n                  clear the search\n                </button>{\" \"}\n                to see every question.\n              </p>\n            </div>\n          </div>\n        ) : (\n          <Accordion type=\"single\" collapsible>\n            {filtered.map((group) => {\n              const groupIndex = groups.findIndex(\n                (original) => original.label === group.label,\n              );\n              return (\n                <div\n                  key={group.label}\n                  role=\"group\"\n                  aria-label={group.label}\n                  className=\"grid gap-2 border-b py-8 md:grid-cols-12 md:gap-8\"\n                >\n                  <div className=\"md:col-span-3\">\n                    <p className=\"font-mono text-xs tracking-wider uppercase md:sticky md:top-24 md:pt-5\">\n                      <span className=\"text-muted-foreground tabular-nums\">\n                        {String(groupIndex + 1).padStart(2, \"0\")} /{\" \"}\n                      </span>\n                      {group.label}\n                    </p>\n                  </div>\n                  <div className=\"divide-y md:col-span-9\">\n                    {group.items.map((item) => (\n                      <AccordionItem\n                        key={item.question}\n                        value={`${group.label}-${item.question}`}\n                        className=\"border-b-0\"\n                      >\n                        <AccordionTrigger className=\"rounded-none py-5 text-base font-medium hover:no-underline [&[data-state=open]]:text-foreground\">\n                          <span className=\"decoration-muted-foreground/40 underline-offset-4 hover:underline\">\n                            {item.question}\n                          </span>\n                        </AccordionTrigger>\n                        <AccordionContent className=\"text-muted-foreground max-w-prose pb-6 text-[15px] leading-relaxed\">\n                          {item.answer}\n                        </AccordionContent>\n                      </AccordionItem>\n                    ))}\n                  </div>\n                </div>\n              );\n            })}\n          </Accordion>\n        )}\n      </div>\n    </section>\n  );\n}\n"
    }
  ],
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "accordion",
    "input"
  ]
}
