"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 MessageConfirmationActions({
  message,
  onExecuteAction,
  isExecuting,
  executingActionId
}) {
  const t = useT();
  const confirmationAction = (message.actionData?.actions ?? []).find((action) => action.id === "confirmation");
  if (!confirmationAction) return null;
  return /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: /* @__PURE__ */ jsx(
    Button,
    {
      type: "button",
      variant: confirmationAction.variant ?? "default",
      size: "sm",
      onClick: () => onExecuteAction(confirmationAction.id),
      disabled: isExecuting || !!message.actionTaken,
      children: isExecuting && executingActionId === confirmationAction.id ? t("messages.actions.executing", "Executing...") : t(confirmationAction.labelKey ?? "messages.actions.confirmation", confirmationAction.label)
    }
  ) });
}
var MessageConfirmationActions_default = MessageConfirmationActions;
export {
  MessageConfirmationActions,
  MessageConfirmationActions_default as default
};
//# sourceMappingURL=MessageConfirmationActions.js.map
