"use client";
import { jsx as t, jsxs as a } from "react/jsx-runtime";
import { Button as l } from "../../../button.js";
import { Popover as o, PopoverTrigger as s, PopoverContent as r } from "../../../popover.js";
function h({
  actions: i,
  i18n: n
}) {
  if (!i?.length) return null;
  if (i.length === 1) {
    const [e] = i;
    return /* @__PURE__ */ t(
      l,
      {
        size: "sm",
        iconLeft: e.icon,
        variant: "default",
        onClick: e.onClick,
        className: "h-6 max-h-6 text-xs",
        "data-testid": e["data-testid"],
        children: e.label
      }
    );
  }
  return /* @__PURE__ */ a(o, { children: [
    /* @__PURE__ */ t(s, { asChild: !0, children: /* @__PURE__ */ t(
      l,
      {
        size: "sm",
        iconRight: "ChevronDown",
        variant: "default",
        className: "h-6 max-h-6 !px-2 text-xs",
        children: n.tableActions.actions
      }
    ) }),
    /* @__PURE__ */ t(
      r,
      {
        side: "top",
        className: "flex w-auto flex-col p-2",
        align: "end",
        children: i.map((e) => /* @__PURE__ */ t(
          l,
          {
            variant: "ghost",
            iconLeft: e.icon,
            size: "sm",
            onClick: e.onClick,
            className: "justify-start text-xs",
            "data-testid": e["data-testid"],
            children: e.label
          },
          e.label
        ))
      }
    )
  ] });
}
export {
  h as DataTableActionsComponent
};
