{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "carousel8",
  "title": "Carousel",
  "description": "Carousel built with shadcn/ui.",
  "dependencies": [
    "lucide-react@0"
  ],
  "registryDependencies": [
    "button",
    "carousel"
  ],
  "files": [
    {
      "path": "contents/components/carousel/8/index.tsx",
      "content": "\"use client\";\n\nimport Image from \"next/image\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n  Carousel,\n  CarouselContent,\n  CarouselItem,\n  type CarouselApi,\n} from \"@/components/ui/carousel\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { useState, useEffect } from \"react\";\n\nconst images = [\n  \"https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=800&h=600&fit=crop\",\n  \"https://images.unsplash.com/photo-1469474968028-56623f02e42e?w=800&h=600&fit=crop\",\n  \"https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=800&h=600&fit=crop\",\n];\n\nexport default function CarouselComponent() {\n  const [api, setApi] = useState<CarouselApi>();\n  const [canScrollPrev, setCanScrollPrev] = useState(false);\n  const [canScrollNext, setCanScrollNext] = useState(false);\n\n  useEffect(() => {\n    if (!api) {\n      return;\n    }\n\n    setCanScrollPrev(api.canScrollPrev());\n    setCanScrollNext(api.canScrollNext());\n\n    api.on(\"select\", () => {\n      setCanScrollPrev(api.canScrollPrev());\n      setCanScrollNext(api.canScrollNext());\n    });\n  }, [api]);\n\n  return (\n    <div className=\"relative w-full max-w-xs\">\n      <Carousel setApi={setApi} className=\"w-full\">\n        <CarouselContent>\n          {images.map((src, index) => (\n            <CarouselItem key={index}>\n              <figure>\n                <Image\n                  src={src}\n                  alt={`Image ${index + 1}`}\n                  width={800}\n                  height={600}\n                  className=\"aspect-4/3 rounded-lg object-cover\"\n                />\n              </figure>\n            </CarouselItem>\n          ))}\n        </CarouselContent>\n      </Carousel>\n      <div className=\"mt-4 flex justify-center gap-2\">\n        <Button\n          variant=\"outline\"\n          size=\"icon\"\n          onClick={() => api?.scrollPrev()}\n          disabled={!canScrollPrev}\n        >\n          <ChevronLeft />\n        </Button>\n        <Button\n          variant=\"outline\"\n          size=\"icon\"\n          onClick={() => api?.scrollNext()}\n          disabled={!canScrollNext}\n        >\n          <ChevronRight />\n        </Button>\n      </div>\n    </div>\n  );\n}\n\n",
      "type": "registry:component",
      "target": "components/carousel8.tsx"
    }
  ],
  "type": "registry:component"
}