"use client";
import { useState, useCallback, useEffect } from 'react';
import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import * as AvatarPrimitive from '@radix-ui/react-avatar';
import { jsx, jsxs } from 'react/jsx-runtime';

// components/blocks/reviews/testimonials-slider-minimal.tsx
function cn(...inputs) {
  return twMerge(clsx(inputs));
}
function Avatar({
  className,
  ...props
}) {
  return /* @__PURE__ */ jsx(
    AvatarPrimitive.Root,
    {
      "data-slot": "avatar",
      className: cn(
        "relative flex size-8 shrink-0 overflow-hidden rounded-full",
        className
      ),
      ...props
    }
  );
}
function AvatarImage({
  className,
  ...props
}) {
  return /* @__PURE__ */ jsx(
    AvatarPrimitive.Image,
    {
      "data-slot": "avatar-image",
      className: cn("aspect-square size-full", className),
      ...props
    }
  );
}
function AvatarFallback({
  className,
  ...props
}) {
  return /* @__PURE__ */ jsx(
    AvatarPrimitive.Fallback,
    {
      "data-slot": "avatar-fallback",
      className: cn(
        "bg-muted flex size-full items-center justify-center rounded-full",
        className
      ),
      ...props
    }
  );
}

// lib/blockBrandedIconsAndPlaceholders.ts
var blockBrandedIconsAndPlaceholders = {
  avatar1: "https://cdn.ing/assets/i/r/286239/ebm7o3j2kx48vw98emnwjaf5qvl6/avatar-1.webp",
  avatar2: "https://cdn.ing/assets/i/r/286240/vgf3rrkwn0769pfdtpal60uo5vpw/avatar-2.webp",
  avatar3: "https://cdn.ing/assets/i/r/286241/05vbqt3lls0q974r8fv4zn0njllq/avatar-3.webp"};
var DEFAULT_TESTIMONIALS = [
  {
    id: "1",
    quote: "This platform has completely transformed how our team collaborates. The intuitive interface and powerful features have made us significantly more productive.",
    author: {
      name: "Sarah Chen",
      role: "Product Manager at TechCorp",
      avatar: blockBrandedIconsAndPlaceholders.avatar1
    }
  },
  {
    id: "2",
    quote: "I've tried dozens of similar tools, but nothing comes close to the elegance and functionality of this solution. It's become indispensable to our workflow.",
    author: {
      name: "Michael Torres",
      role: "CEO at StartupXYZ",
      avatar: blockBrandedIconsAndPlaceholders.avatar2
    }
  },
  {
    id: "3",
    quote: "The customer support is exceptional. Any time we've had questions, the team has been incredibly responsive and helpful. Truly a pleasure to work with.",
    author: {
      name: "Emily Watson",
      role: "Operations Lead at GrowthCo",
      avatar: blockBrandedIconsAndPlaceholders.avatar3
    }
  }
];
function TestimonialsSliderMinimal({
  testimonials = DEFAULT_TESTIMONIALS,
  autoPlayInterval = 5e3,
  className
}) {
  const [currentIndex, setCurrentIndex] = useState(0);
  const [isTransitioning, setIsTransitioning] = useState(false);
  const goToSlide = useCallback(
    (index) => {
      if (index === currentIndex) return;
      setIsTransitioning(true);
      setTimeout(() => {
        setCurrentIndex(index);
        setIsTransitioning(false);
      }, 300);
    },
    [currentIndex]
  );
  useEffect(() => {
    if (autoPlayInterval <= 0) return;
    const interval = setInterval(() => {
      const nextIndex = (currentIndex + 1) % testimonials.length;
      goToSlide(nextIndex);
    }, autoPlayInterval);
    return () => clearInterval(interval);
  }, [currentIndex, autoPlayInterval, testimonials.length, goToSlide]);
  const current = testimonials[currentIndex];
  return /* @__PURE__ */ jsx("section", { className: cn("py-16 md:py-24", className), children: /* @__PURE__ */ jsx("div", { className: "container", children: /* @__PURE__ */ jsxs("div", { className: "mx-auto max-w-3xl text-center", children: [
    /* @__PURE__ */ jsxs(
      "div",
      {
        className: cn(
          "transition-opacity duration-300",
          isTransitioning ? "opacity-0" : "opacity-100"
        ),
        children: [
          /* @__PURE__ */ jsxs("blockquote", { className: "text-xl font-medium leading-relaxed md:text-2xl lg:text-3xl", children: [
            "\u201C",
            current.quote,
            "\u201D"
          ] }),
          /* @__PURE__ */ jsxs("div", { className: "mt-8 flex flex-col items-center gap-4", children: [
            /* @__PURE__ */ jsxs(Avatar, { className: "size-14", children: [
              /* @__PURE__ */ jsx(
                AvatarImage,
                {
                  src: current.author.avatar,
                  alt: current.author.name
                }
              ),
              /* @__PURE__ */ jsx(AvatarFallback, { children: current.author.name.split(" ").map((n) => n[0]).join("") })
            ] }),
            /* @__PURE__ */ jsxs("div", { children: [
              /* @__PURE__ */ jsx("p", { className: "font-semibold", children: current.author.name }),
              current.author.role && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: current.author.role })
            ] })
          ] })
        ]
      }
    ),
    /* @__PURE__ */ jsx("div", { className: "mt-8 flex justify-center gap-2", children: testimonials.map((_, index) => /* @__PURE__ */ jsx(
      "button",
      {
        onClick: () => goToSlide(index),
        className: cn(
          "size-2 rounded-full transition-all",
          index === currentIndex ? "w-6 bg-primary" : "bg-muted-foreground/30 hover:bg-muted-foreground/50"
        ),
        "aria-label": `Go to testimonial ${index + 1}`
      },
      index
    )) })
  ] }) }) });
}

export { TestimonialsSliderMinimal };
//# sourceMappingURL=testimonials-slider-minimal.js.map
//# sourceMappingURL=testimonials-slider-minimal.js.map