{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "testimonial1",
  "title": "Carousel Testimonials",
  "description": "Full-width swipeable testimonial carousel with autoplay and dot navigation. Perfect for highlighting multiple customer quotes on landing pages.",
  "dependencies": [
    "clsx",
    "tailwind-merge",
    "embla-carousel-react",
    "embla-carousel-autoplay"
  ],
  "registryDependencies": [
    "badge",
    "button"
  ],
  "files": [
    {
      "path": "registry/testimonial1/testimonial1.tsx",
      "content": "\"use client\";\n\nimport { useCallback, useEffect, useState } from \"react\";\n\nimport Autoplay from \"embla-carousel-autoplay\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\nimport useEmblaCarousel from \"embla-carousel-react\";\n\ninterface TestimonialItem {\n  id: string;\n  text: string;\n  name: string;\n  role: string;\n  avatar?: {\n    src: string;\n    alt: string;\n  };\n}\n\ninterface Testimonial1Props {\n  badge?: {\n    label: string;\n    variant?: \"default\" | \"secondary\" | \"outline\";\n  };\n  heading?: string;\n  description?: string;\n  testimonials: TestimonialItem[];\n  autoplay?: boolean;\n  autoplayDelay?: number;\n  className?: string;\n}\n\nexport const testimonial1Demo: Testimonial1Props = {\n  badge: { label: \"Testimonials\", variant: \"secondary\" },\n  heading: \"Loved by teams worldwide\",\n  description: \"Hear from the people who use our platform every day to build amazing things.\",\n  testimonials: [\n    {\n      id: \"testimonial-1\",\n      text: \"This platform has completely transformed how our team collaborates. The intuitive interface and powerful features have made us more productive than ever.\",\n      name: \"Sarah Chen\",\n      role: \"Engineering Manager at TechCorp\",\n      avatar: {\n        src: \"https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=150&h=150&fit=crop&crop=face\",\n        alt: \"Sarah Chen\",\n      },\n    },\n    {\n      id: \"testimonial-2\",\n      text: \"I've tried many similar tools, but nothing comes close. The attention to detail and customer support are unmatched in the industry.\",\n      name: \"Marcus Johnson\",\n      role: \"Product Designer at Startup Inc\",\n      avatar: {\n        src: \"https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=150&h=150&fit=crop&crop=face\",\n        alt: \"Marcus Johnson\",\n      },\n    },\n    {\n      id: \"testimonial-3\",\n      text: \"We reduced our development time by 40% after switching. It's not just a tool, it's a game changer for our entire workflow.\",\n      name: \"Emily Rodriguez\",\n      role: \"CTO at Innovation Labs\",\n      avatar: {\n        src: \"https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=150&h=150&fit=crop&crop=face\",\n        alt: \"Emily Rodriguez\",\n      },\n    },\n  ],\n  autoplay: true,\n  autoplayDelay: 5000,\n};\n\nexport function Testimonial1({\n  badge,\n  heading,\n  description,\n  testimonials,\n  autoplay = true,\n  autoplayDelay = 5000,\n  className,\n}: Testimonial1Props) {\n  const [selectedIndex, setSelectedIndex] = useState(0);\n\n  const autoplayPlugin = Autoplay({\n    delay: autoplayDelay,\n    stopOnInteraction: true,\n  });\n\n  const [emblaRef, emblaApi] = useEmblaCarousel(\n    { loop: true, align: \"center\" },\n    autoplay ? [autoplayPlugin] : []\n  );\n\n  const scrollTo = useCallback(\n    (index: number) => {\n      if (emblaApi) emblaApi.scrollTo(index);\n    },\n    [emblaApi]\n  );\n\n  const onSelect = useCallback(() => {\n    if (!emblaApi) return;\n    setSelectedIndex(emblaApi.selectedScrollSnap());\n  }, [emblaApi]);\n\n  useEffect(() => {\n    if (!emblaApi) return;\n    onSelect();\n    emblaApi.on(\"select\", onSelect);\n    return () => {\n      emblaApi.off(\"select\", onSelect);\n    };\n  }, [emblaApi, onSelect]);\n\n  if (!testimonials || testimonials.length === 0) return null;\n\n  return (\n    <section className={cn(\"py-16 md:py-24 w-full\", className)}>\n      <div className=\"mx-auto w-full px-4 md:px-6\">\n        {(badge || heading || description) && (\n          <div className=\"mx-auto mb-16 max-w-3xl text-center\">\n            {badge && (\n              <div className=\"mb-5 flex justify-center\">\n                <Badge variant={badge.variant ?? \"default\"}>{badge.label}</Badge>\n              </div>\n            )}\n            {heading && (\n              <h2 className=\"text-3xl font-semibold md:text-4xl lg:text-5xl\">{heading}</h2>\n            )}\n            {description && (\n              <p className=\"mt-4 text-base md:text-lg text-muted-foreground\">{description}</p>\n            )}\n          </div>\n        )}\n\n        <div className=\"overflow-hidden\" ref={emblaRef}>\n          <div className=\"flex\">\n            {testimonials.map((testimonial) => (\n              <div key={testimonial.id} className=\"min-w-0 flex-[0_0_100%] px-4\">\n                <div className=\"flex flex-col items-center text-center\">\n                  <p className=\"mb-8 max-w-4xl text-lg font-normal md:px-8 lg:text-2xl\">\n                    &ldquo;{testimonial.text}&rdquo;\n                  </p>\n                  {testimonial.avatar?.src && (\n                    <div className=\"relative size-24 overflow-hidden rounded-full\">\n                      <img\n                        className=\"absolute inset-0 size-full object-cover\"\n                        src={testimonial.avatar.src}\n                        alt={testimonial.avatar.alt ?? testimonial.name}\n                      />\n                    </div>\n                  )}\n                  <p className=\"mt-4 text-sm font-medium md:text-lg\">{testimonial.name}</p>\n                  <p className=\"text-sm text-muted-foreground md:text-base\">{testimonial.role}</p>\n                </div>\n              </div>\n            ))}\n          </div>\n        </div>\n\n        {testimonials.length > 1 && (\n          <div className=\"mt-12 flex justify-center gap-2\">\n            {testimonials.map((_, index) => (\n              <Button\n                key={index}\n                variant=\"ghost\"\n                size=\"sm\"\n                onClick={() => scrollTo(index)}\n                className=\"p-2\"\n              >\n                <div\n                  className={cn(\n                    \"size-2 rounded-full transition-colors\",\n                    index === selectedIndex ? \"bg-primary\" : \"bg-muted\"\n                  )}\n                />\n              </Button>\n            ))}\n          </div>\n        )}\n      </div>\n    </section>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/beste/block/testimonial1.tsx"
    }
  ],
  "type": "registry:block"
}