import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import { jsx, jsxs } from 'react/jsx-runtime';

// src/lib/utils.ts
function cn(...inputs) {
  return twMerge(clsx(inputs));
}
function Author({ item }) {
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
    item.avatar ? /* @__PURE__ */ jsx("div", { className: "flex-none", children: item.avatar }) : null,
    /* @__PURE__ */ jsxs("div", { className: "text-sm", children: [
      /* @__PURE__ */ jsx("div", { className: "font-semibold text-foreground", children: item.authorName }),
      item.authorTitle ? /* @__PURE__ */ jsx("div", { className: "text-muted-foreground", children: item.authorTitle }) : null
    ] })
  ] });
}
function MarketingTestimonial({
  eyebrow,
  title,
  testimonials,
  layout = "single",
  className
}) {
  const hasHeading = Boolean(eyebrow || title);
  if (layout === "single") {
    const item = testimonials[0];
    if (!item) return null;
    return /* @__PURE__ */ jsx("section", { className: cn("bg-background py-24 sm:py-32", className), children: /* @__PURE__ */ jsxs("figure", { className: "mx-auto flex max-w-3xl flex-col items-center gap-8 px-6 text-center lg:px-8", children: [
      /* @__PURE__ */ jsx("blockquote", { className: "text-balance text-2xl font-medium text-foreground sm:text-3xl", children: item.quote }),
      /* @__PURE__ */ jsx("figcaption", { children: /* @__PURE__ */ jsx(Author, { item }) })
    ] }) });
  }
  return /* @__PURE__ */ jsx("section", { className: cn("bg-background py-24 sm:py-32", className), children: /* @__PURE__ */ jsxs("div", { className: "mx-auto max-w-7xl px-6 lg:px-8", children: [
    hasHeading ? /* @__PURE__ */ jsxs("div", { className: "mx-auto flex max-w-2xl flex-col items-center gap-4 text-center", children: [
      eyebrow ? /* @__PURE__ */ jsx("p", { className: "text-sm font-semibold uppercase tracking-wide text-primary", children: eyebrow }) : null,
      title ? /* @__PURE__ */ jsx("h2", { className: "text-balance text-3xl font-semibold tracking-tight text-foreground sm:text-4xl", children: title }) : null
    ] }) : null,
    /* @__PURE__ */ jsx(
      "div",
      {
        className: cn(
          "grid grid-cols-1 gap-8 sm:grid-cols-2 lg:grid-cols-3",
          hasHeading && "mt-16"
        ),
        children: testimonials.map((item, index) => /* @__PURE__ */ jsxs(
          "figure",
          {
            className: "flex flex-col gap-6 rounded-2xl border border-border bg-card p-8 text-card-foreground shadow-sm",
            children: [
              /* @__PURE__ */ jsx("blockquote", { className: "flex-1 text-pretty text-base text-foreground", children: item.quote }),
              /* @__PURE__ */ jsx("figcaption", { children: /* @__PURE__ */ jsx(Author, { item }) })
            ]
          },
          index
        ))
      }
    )
  ] }) });
}

export { MarketingTestimonial };
//# sourceMappingURL=marketing-testimonial.js.map
//# sourceMappingURL=marketing-testimonial.js.map