{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "books-01",
  "title": "Bookstore Section",
  "author": "VenusUI",
  "description": "A shelf of staff picks; pulling a book out shows its cover, rating, blurb and a reader review.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "button",
    "https://venusui.com/r/bookshelf.json"
  ],
  "files": [
    {
      "path": "registry/default/blocks/books-01/components/books-01.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Star } from \"lucide-react\"\n\nimport { Button } from \"@/components/ui/button\"\nimport { BookCover, Bookshelf, type ShelfBook } from \"@/registry/default/ui/bookshelf\"\n\n// Portraits: Unsplash (free under the Unsplash License). The books, authors and reviewers are made up.\nconst face = (id: string) => `https://images.unsplash.com/photo-${id}?w=80&h=80&fit=crop&crop=faces&auto=format&q=80`\n\ntype Book = ShelfBook & { price: number; rating: number; blurb: string; review: { name: string; photo: string; text: string } }\n\nconst BOOKS: Book[] = [\n  { id: \"1\", title: \"The Lighthouse Year\", author: \"Ana Okafor\", color: \"#1f3a5f\", ink: \"#f5e9d3\", height: 0.94, thickness: 40, price: 18, rating: 4.6, blurb: \"A keeper’s daughter spends one year alone on a northern island, and learns to read the sea, the gulls and herself.\", review: { name: \"Sofie L.\", photo: \"1438761681033-6461ffad8d80\", text: \"Quiet, salty and completely absorbing.\" } },\n  { id: \"2\", title: \"Salt & Cedar\", author: \"Jonah Reyes\", color: \"#7a2e2a\", ink: \"#f8e4c8\", height: 0.86, thickness: 34, price: 16, rating: 4.3, blurb: \"Two brothers inherit a failing smokehouse on the coast and one summer to save it.\", review: { name: \"Marcus R.\", photo: \"1507003211169-0a1dd7228f2d\", text: \"Made me hungry and homesick in equal measure.\" } },\n  { id: \"3\", title: \"A Field Guide to Quiet\", author: \"Mei Tanaka\", color: \"#2f5d50\", ink: \"#e8f0e2\", height: 1, thickness: 46, price: 22, rating: 4.8, blurb: \"Short essays on finding stillness in loud cities: train platforms, laundromats, the minute before rain.\", review: { name: \"Priya N.\", photo: \"1494790108377-be9c29b29330\", text: \"I read one essay every morning. My favourite book this year.\" } },\n  { id: \"4\", title: \"Midnight Ferry\", author: \"Lars Holm\", color: \"#2b2b3a\", ink: \"#e9d8a6\", height: 0.82, thickness: 30, price: 14, rating: 4.1, blurb: \"A detective, a missing violinist and the last crossing of the night.\", review: { name: \"Tomás A.\", photo: \"1506794778202-cad84cf45f1d\", text: \"Twisty and atmospheric. Read it in one sitting.\" } },\n  { id: \"5\", title: \"The Orchard Letters\", author: \"Priya Shah\", color: \"#c58b3c\", ink: \"#2a1d0e\", height: 0.9, thickness: 38, price: 19, rating: 4.7, blurb: \"Fifty years of letters between two friends, written from an apple orchard and a city flat.\", review: { name: \"Amara O.\", photo: \"1580489944761-15a19d654956\", text: \"I cried twice and called my oldest friend.\" } },\n  { id: \"6\", title: \"Northern Static\", author: \"Elin Berg\", color: \"#4a4e8c\", ink: \"#eef0ff\", height: 0.97, thickness: 42, price: 17, rating: 4.4, blurb: \"A radio host in the far north picks up a broadcast from a station that closed in 1962.\", review: { name: \"David B.\", photo: \"1472099645785-5658abf4ff4e\", text: \"Eerie in the best way.\" } },\n  { id: \"7\", title: \"Paper Boats\", author: \"Sam Idris\", color: \"#d9cfc1\", ink: \"#3a2f25\", height: 0.78, thickness: 32, price: 12, rating: 4.5, blurb: \"A picture book about a girl who sends a paper boat down the river and gets a letter back.\", review: { name: \"Elena M.\", photo: \"1573496359142-b8d87734a5a2\", text: \"My kids ask for it every night.\" } },\n]\n\n/** A bookstore section: a shelf of staff picks and the selected book's details and review. */\nexport function Books01() {\n  const [selected, setSelected] = React.useState(BOOKS[2])\n\n  return (\n    <section aria-labelledby=\"books-01-title\" className=\"py-24 sm:py-28\">\n      <div className=\"mx-auto max-w-5xl px-4 sm:px-6\">\n        <h2 id=\"books-01-title\" className=\"text-3xl font-semibold tracking-tight sm:text-4xl\">\n          Staff picks\n        </h2>\n        <p className=\"mt-2 text-muted-foreground\">Pull a book off the shelf to read about it.</p>\n\n        <Bookshelf className=\"mx-auto mt-6\"label=\"Staff picks\" books={BOOKS} selected={selected.id} onSelect={(b) => setSelected(b as Book)} />\n\n        <article aria-live=\"polite\" className=\"mt-12 grid items-start gap-8 rounded-3xl border bg-card p-6 sm:grid-cols-[10rem_minmax(0,1fr)] sm:p-8\">\n          <BookCover book={selected} className=\"mx-auto w-40\" />\n          <div>\n            <h3 className=\"font-serif text-2xl\">{selected.title}</h3>\n            <p className=\"text-muted-foreground\">{selected.author}</p>\n            <p className=\"mt-2 flex items-center gap-1 text-sm\">\n              <span className=\"flex text-amber-500\" aria-hidden=\"true\">\n                {Array.from({ length: 5 }, (_, i) => (\n                  <Star key={i} className={i < Math.round(selected.rating) ? \"size-4 fill-current\" : \"size-4\"} />\n                ))}\n              </span>\n              <span className=\"ml-1 font-medium\">{selected.rating}</span>\n              <span className=\"sr-only\">out of 5</span>\n            </p>\n            <p className=\"mt-4 leading-7 text-muted-foreground\">{selected.blurb}</p>\n            <figure className=\"mt-5 flex items-start gap-3 rounded-2xl bg-muted/50 p-4\">\n              <img src={face(selected.review.photo)} alt=\"\" className=\"size-9 rounded-full object-cover\" />\n              <div className=\"text-sm\">\n                <blockquote>“{selected.review.text}”</blockquote>\n                <figcaption className=\"mt-1 text-muted-foreground\">{selected.review.name}</figcaption>\n              </div>\n            </figure>\n            <div className=\"mt-6 flex items-center gap-4\">\n              <span className=\"text-2xl font-semibold tabular-nums\">${selected.price}</span>\n              <Button>Add to basket</Button>\n            </div>\n          </div>\n        </article>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "version": "0.1.0"
  },
  "categories": [
    "content"
  ],
  "type": "registry:block"
}