"use client";
import { jsx } from "react/jsx-runtime";
import { useT } from "@open-mercato/shared/lib/i18n/context";
import { Button } from "@open-mercato/ui/primitives/button";
function DefaultMessageActions({
  message,
  onExecuteAction,
  isExecuting,
  executingActionId
}) {
  const t = useT();
  const actions = message.actionData?.actions ?? [];
  if (actions.length === 0) return null;
  return /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: actions.map((action) => /* @__PURE__ */ jsx(
    Button,
    {
      variant: action.variant ?? "default",
      size: "sm",
      onClick: () => onExecuteAction(action.id),
      disabled: isExecuting || !!message.actionTaken,
      children: isExecuting && executingActionId === action.id ? t("messages.actions.executing", "Executing...") : t(action.labelKey ?? action.label, action.label)
    },
    action.id
  )) });
}
var DefaultMessageActions_default = DefaultMessageActions;
export {
  DefaultMessageActions,
  DefaultMessageActions_default as default
};
//# sourceMappingURL=DefaultMessageActions.js.map
