{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "footnote-feature",
  "type": "registry:block",
  "title": "Footnote Feature",
  "description": "Feature Section built with Footnote (AI answer with citations): an AI answer cites its sources as it writes. A take on the citations (footnotes). A feature section about answers you can check. Beside three plain points, a Footnote answers a traveler's question: it reads its sources, writes the answer and flies each citation from its source into the sentence it backs. Follow-up questions under the card ask the next one, and the old answer folds away.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "blocks",
    "feature-sections",
    "features",
    "citations"
  ],
  "docs": "Live preview and the components it's built with: https://keyframeui.com/blocks/feature-sections/footnote-feature",
  "registryDependencies": [
    "https://keyframeui.com/r/footnote.json"
  ],
  "files": [
    {
      "path": "components/footnote-feature.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { Footnote, type FootnoteClaim, type FootnoteSource } from \"@/components/ui/footnote\";\n\n/* ── Content ─────────────────────────────────────────────────\n * Everything you'd change to make the section yours: the copy,\n * the three points beside the answer, and the questions it\n * answers, each with the sources it cites.\n * ─────────────────────────────────────────────────────────── */\n\n/** The one accent: the citation numbers and the highlights in the answer. */\nconst ACCENT = { light: \"#5b54d6\", dark: \"#a49dff\" };\n\nconst EYEBROW = \"Sources, not guesses\";\nconst HEADLINE = \"Every time, price and opening hour links to where it came from.\";\nconst POINTS: { title: string; body: string; icon: \"read\" | \"tap\" | \"unsure\" }[] = [\n  {\n    title: \"Reads before it writes\",\n    body: \"Timetables, opening hours and local guides come first. The plan comes after.\",\n    icon: \"read\",\n  },\n  {\n    title: \"One tap to the source\",\n    body: \"Each claim carries a number. Tap it to see the page and the line it relied on.\",\n    icon: \"tap\",\n  },\n  {\n    title: \"Says what it couldn't check\",\n    body: \"No timetable online? It tells you to call, and gives you the number.\",\n    icon: \"unsure\",\n  },\n];\nconst ASK_LABEL = \"Ask next\";\n\ntype Turn = { question: string; answer: FootnoteClaim[]; sources: FootnoteSource[]; read: number };\n\nconst SOURCES = {\n  museum: {\n    id: \"museum\",\n    site: \"rivermuseum.org\",\n    title: \"River Museum: opening hours\",\n    href: \"#river-museum\",\n    snippet: \"Open Tuesday to Sunday, 10:00 to 18:00. Closed on Mondays and public holidays.\",\n    quote: \"Closed on Mondays\",\n  },\n  market: {\n    id: \"market\",\n    site: \"vilabrava.town\",\n    title: \"Covered market: days and hours\",\n    href: \"#market\",\n    snippet: \"The covered market opens Monday to Saturday from 07:00 to 13:00.\",\n    quote: \"Monday to Saturday from 07:00 to 13:00\",\n  },\n  boats: {\n    id: \"boats\",\n    site: \"riverboats.travel\",\n    title: \"Boat trips: timetable\",\n    href: \"#boats\",\n    snippet:\n      \"Boats leave Vila Brava quay at 11:00 and 15:30 every day from April to October. The 15:30 boat stops at Pinhal quay, ten minutes' walk from the station.\",\n    quote: \"at 11:00 and 15:30 every day\",\n  },\n  estates: {\n    id: \"estates\",\n    site: \"bravaestates.org\",\n    title: \"Wine estates: visits and bookings\",\n    href: \"#estates\",\n    snippet: \"Quinta Lume and Casa Alta open seven days a week. The other estates close on Mondays.\",\n    quote: \"open seven days a week\",\n  },\n  rail: {\n    id: \"rail\",\n    site: \"valleyline.travel\",\n    title: \"Valley Line timetable, winter 2026\",\n    href: \"#valley-line\",\n    snippet: \"Trains stop at Vila Brava and Pinhal every two hours. The last train back to Porto Lume leaves at 19:40.\",\n    quote: \"every two hours\",\n  },\n  bikes: {\n    id: \"bikes\",\n    site: \"bravabikes.co\",\n    title: \"E-bike hire\",\n    href: \"#bikes\",\n    snippet: \"E-bikes from €28 a day. One charge covers the 34 km river loop twice over.\",\n    quote: \"covers the 34 km river loop twice over\",\n  },\n  inns: {\n    id: \"inns\",\n    site: \"staybrava.com\",\n    title: \"Inns near the station\",\n    href: \"#inns\",\n    snippet: \"Casa do Rio is 300 m from the station, with rooms from €95 a night.\",\n    quote: \"300 m from the station\",\n  },\n  ridge: {\n    id: \"ridge\",\n    site: \"serraalta.trails\",\n    title: \"North Ridge viewpoint\",\n    href: \"#north-ridge\",\n    snippet: \"The upper car park is 12 minutes by taxi from Vila Brava station, and the viewpoint is 15 minutes on foot from there.\",\n    quote: \"12 minutes by taxi\",\n  },\n} satisfies Record<string, FootnoteSource>;\n\nconst TURNS: Turn[] = [\n  {\n    question: \"What's actually open in Vila Brava on a Monday?\",\n    answer: [\n      { text: \"The River Museum is closed, but the covered market runs until 13:00.\", cite: [\"museum\", \"market\"] },\n      { text: \"Boat trips still leave the quay at 11:00 and 15:30.\", cite: \"boats\" },\n      { text: \"Only Quinta Lume and Casa Alta open their cellars on Mondays, so book one of those.\", cite: \"estates\" },\n    ],\n    sources: [SOURCES.museum, SOURCES.market, SOURCES.boats, SOURCES.estates],\n    read: 8,\n  },\n  {\n    question: \"Can we do the valley without a car?\",\n    answer: [\n      { text: \"Yes: the Valley Line stops at Vila Brava and Pinhal every two hours.\", cite: \"rail\" },\n      { text: \"Hire an e-bike for the river loop; one charge covers its 34 km twice.\", cite: \"bikes\" },\n      { text: \"Take the 15:30 boat to Pinhal and walk ten minutes to the train.\", cite: [\"boats\", \"rail\"] },\n    ],\n    sources: [SOURCES.rail, SOURCES.bikes, SOURCES.boats],\n    read: 6,\n  },\n  {\n    question: \"Where should we stay for both sunrise and the last train?\",\n    answer: [\n      { text: \"Casa do Rio is 300 m from the station, so the 19:40 home is never a rush.\", cite: [\"inns\", \"rail\"] },\n      { text: \"For sunrise, a taxi reaches the North Ridge car park in 12 minutes.\", cite: \"ridge\" },\n    ],\n    sources: [SOURCES.inns, SOURCES.rail, SOURCES.ridge],\n    read: 7,\n  },\n];\n\n/* ── Section ─────────────────────────────────────────────── */\n\nexport function FootnoteFeature() {\n  const [current, setCurrent] = React.useState(0);\n  const turn = TURNS[current];\n\n  return (\n    <section\n      aria-labelledby=\"footnote-feature-title\"\n      style={{ \"--accent-light\": ACCENT.light, \"--accent-dark\": ACCENT.dark } as React.CSSProperties}\n      className=\"bg-[#f3f1ec] text-zinc-950 [--footnote-accent:var(--accent-light)] dark:bg-zinc-950 dark:text-white dark:[--footnote-accent:var(--accent-dark)]\"\n    >\n      <div className=\"mx-auto grid max-w-6xl items-start gap-12 px-6 py-24 sm:py-32 lg:grid-cols-[1fr_1.1fr] lg:gap-16\">\n        <div>\n          <p className=\"text-sm font-medium text-zinc-500 dark:text-zinc-400\">{EYEBROW}</p>\n          <h2\n            id=\"footnote-feature-title\"\n            className=\"mt-3 max-w-[18ch] text-4xl/[1.05] font-medium tracking-[-0.035em] text-balance sm:text-5xl/[1.02]\"\n          >\n            {HEADLINE}\n          </h2>\n          <ul className=\"mt-10 flex flex-col gap-6\">\n            {POINTS.map((point) => (\n              <li key={point.title} className=\"flex gap-4\">\n                <span className=\"mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-xl bg-white text-(--footnote-accent) shadow-sm ring-1 ring-zinc-950/5 dark:bg-white/[0.06] dark:ring-white/10\">\n                  <PointIcon name={point.icon} className=\"size-4\" />\n                </span>\n                <span>\n                  <span className=\"block text-[15px] font-medium tracking-tight\">{point.title}</span>\n                  <span className=\"mt-1 block max-w-sm text-sm/6 text-pretty text-zinc-600 dark:text-zinc-400\">{point.body}</span>\n                </span>\n              </li>\n            ))}\n          </ul>\n        </div>\n\n        <div className=\"rounded-[2rem] bg-white/50 p-3 ring-1 ring-zinc-950/5 sm:p-5 dark:bg-white/[0.03] dark:ring-white/[0.06]\">\n          <Footnote\n            question={turn.question}\n            answer={turn.answer}\n            sources={turn.sources}\n            read={turn.read}\n            avatar={<MeanderMark className=\"size-3.5\" />}\n            className=\"shadow-sm\"\n          />\n          <div className=\"mt-4 flex flex-wrap items-center gap-1.5 px-1\">\n            <span className=\"mr-1 text-xs text-zinc-500 dark:text-zinc-400\">{ASK_LABEL}</span>\n            {TURNS.map((t, i) =>\n              i === current ? null : (\n                <button\n                  key={t.question}\n                  type=\"button\"\n                  onClick={() => setCurrent(i)}\n                  className=\"inline-flex min-h-8 items-center gap-1.5 rounded-full bg-white px-3 py-1.5 text-left text-xs text-zinc-700 shadow-sm ring-1 ring-zinc-950/10 transition-[background-color,color,scale] duration-150 ease-out hover:bg-zinc-50 hover:text-zinc-950 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-zinc-950 active:scale-[0.97] dark:bg-zinc-900 dark:text-zinc-300 dark:ring-white/10 dark:hover:bg-zinc-800 dark:hover:text-white dark:focus-visible:outline-white\"\n                >\n                  <ReplyIcon className=\"size-3 shrink-0 text-zinc-400\" />\n                  {t.question}\n                </button>\n              ),\n            )}\n          </div>\n        </div>\n      </div>\n    </section>\n  );\n}\n\n/* ── Icons ───────────────────────────────────────────────── */\n\nfunction PointIcon({ name, className }: { name: \"read\" | \"tap\" | \"unsure\"; className?: string }) {\n  const paths = {\n    read: \"M2.5 3.5h4a1.5 1.5 0 0 1 1.5 1.5v8a1.5 1.5 0 0 0-1.5-1.5h-4Zm11 0h-4A1.5 1.5 0 0 0 8 5v8a1.5 1.5 0 0 1 1.5-1.5h4Z\",\n    tap: \"M6 9.5V3.75a1.25 1.25 0 0 1 2.5 0V8l3 .6a1.6 1.6 0 0 1 1.3 1.8l-.5 3.1H6.6L4.4 10.8a1.1 1.1 0 0 1 1.6-1.3Z\",\n    unsure: \"M6.2 6.2a1.9 1.9 0 1 1 2.4 1.8c-.4.2-.6.5-.6.9v.6M8 11.6v.1M14 8A6 6 0 1 1 2 8a6 6 0 0 1 12 0Z\",\n  } as const;\n  return (\n    <svg viewBox=\"0 0 16 16\" className={className} fill=\"none\" stroke=\"currentColor\" strokeWidth={1.4} aria-hidden>\n      <path d={paths[name]} strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n    </svg>\n  );\n}\n\nfunction MeanderMark({ className }: { className?: string }) {\n  return (\n    <svg viewBox=\"0 0 20 20\" className={className} fill=\"none\" aria-hidden>\n      <path\n        d=\"M3.5 17.5c0-3.6 5.5-3.4 5.5-7S4.6 6.2 7.2 2.5M11 17.5c0-3 5.5-3 5.5-6.4\"\n        stroke=\"currentColor\"\n        strokeWidth={2}\n        strokeLinecap=\"round\"\n      />\n    </svg>\n  );\n}\n\nfunction ReplyIcon({ className }: { className?: string }) {\n  return (\n    <svg viewBox=\"0 0 12 12\" className={className} fill=\"none\" aria-hidden>\n      <path\n        d=\"M2.5 2.5v3a2 2 0 0 0 2 2h5m0 0L7.5 5.5m2 2-2 2\"\n        stroke=\"currentColor\"\n        strokeWidth={1.3}\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n      />\n    </svg>\n  );\n}\n"
    }
  ]
}