{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"docs-sidebar-with-section-headings","type":"registry:component","title":"Docs Sidebar With Section Headings","description":"","dependencies":[],"files":[{"path":"components/we-inc/docs-sidebar-with-section-headings.tsx","type":"registry:component","content":"import { useState } from \"react\";\n\n// Documentation sections. Headings are plain text; pages are links.\nconst sections = [\n  { heading: \"Getting started\", pages: [\"Introduction\", \"Install the CLI\", \"Your first sync\"] },\n  { heading: \"Guides\", pages: [\"Scheduling jobs\", \"Retries and backoff\", \"Webhooks\", \"Secrets\"] },\n  { heading: \"Reference\", pages: [\"Config file\", \"CLI commands\", \"REST API\"] },\n];\n\nexport default function DocsSidebarWithSectionHeadings() {\n  const [current, setCurrent] = useState(\"Retries and backoff\");\n  const [query, setQuery] = useState(\"\");\n  const q = query.trim().toLowerCase();\n\n  return (\n    <div className=\"bg-white px-4 py-10 sm:px-8\">\n      <div className=\"mx-auto flex h-[560px] max-w-5xl overflow-hidden rounded-xl border border-slate-200\">\n        <aside className=\"w-full shrink-0 overflow-y-auto border-slate-200 bg-white px-4 py-5 sm:w-64 sm:border-r\">\n          <p className=\"px-2 font-mono text-sm font-semibold text-slate-900\">tidepool<span className=\"text-sky-600\">/docs</span></p>\n          <label htmlFor=\"dss-search\" className=\"sr-only\">Filter pages</label>\n          <input\n            id=\"dss-search\"\n            type=\"search\"\n            value={query}\n            onChange={(e) => setQuery(e.target.value)}\n            placeholder=\"Filter pages\"\n            className=\"mt-4 h-10 w-full rounded-md border border-slate-300 bg-slate-50 px-3 text-sm text-slate-900 placeholder:text-slate-500 focus:border-sky-500 focus:outline-none focus:ring-2 focus:ring-sky-200\"\n          />\n          <nav aria-label=\"Documentation\" className=\"mt-5 space-y-6\">\n            {sections.map((s) => {\n              const pages = s.pages.filter((p) => p.toLowerCase().includes(q));\n              if (!pages.length) return null;\n              return (\n                <div key={s.heading}>\n                  <h3 className=\"px-2 text-xs font-semibold uppercase tracking-wider text-slate-500\">{s.heading}</h3>\n                  <ul className=\"mt-2 border-l border-slate-200\">\n                    {pages.map((p) => (\n                      <li key={p}>\n                        <a\n                          href=\"#\"\n                          aria-current={current === p ? \"page\" : undefined}\n                          onClick={(e) => { e.preventDefault(); setCurrent(p); }}\n                          className={`-ml-px flex min-h-[40px] items-center border-l-2 pl-4 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-500 ${current === p ? \"border-sky-600 font-medium text-sky-700\" : \"border-transparent text-slate-600 hover:border-slate-400 hover:text-slate-900\"}`}\n                        >\n                          {p}\n                        </a>\n                      </li>\n                    ))}\n                  </ul>\n                </div>\n              );\n            })}\n            {!sections.some((s) => s.pages.some((p) => p.toLowerCase().includes(q))) && (\n              <p className=\"px-2 text-sm text-slate-600\">No pages match \"{query}\".</p>\n            )}\n          </nav>\n        </aside>\n        <article className=\"hidden min-w-0 flex-1 px-10 py-8 sm:block\">\n          <p className=\"text-sm text-slate-600\">Guides</p>\n          <h2 className=\"mt-1 text-3xl font-semibold tracking-tight text-slate-900\">{current}</h2>\n          <p className=\"mt-4 max-w-prose leading-7 text-slate-600\">A failed job is tried again up to five times, waiting longer after each attempt. Set the limit and the first delay in your config file.</p>\n          <pre className=\"mt-6 overflow-x-auto rounded-lg bg-slate-900 p-4 font-mono text-sm text-slate-100\">{`retry:\\n  attempts: 5\\n  delay: 30s\\n  backoff: exponential`}</pre>\n        </article>\n      </div>\n    </div>\n  );\n}\n"}]}
