"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { ExternalLink, RefreshCw, Replace, Trash2 } from "lucide-react";
import { Button } from "@open-mercato/ui/primitives/button";
import { useT } from "@open-mercato/shared/lib/i18n/context";
function DefaultActions({
  mapping,
  isReplacement,
  onCheckNow,
  onRetryTls,
  onChangeDomain,
  onRemove,
  busy
}) {
  const t = useT();
  const showCheckNow = mapping.status === "pending" || mapping.status === "dns_failed";
  const showRetryTls = mapping.status === "tls_failed" || mapping.status === "verified";
  const showTestDomain = mapping.status === "active";
  const showChangeDomain = mapping.status === "active" && !isReplacement;
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
    showCheckNow ? /* @__PURE__ */ jsxs(Button, { type: "button", variant: "outline", size: "sm", onClick: onCheckNow, disabled: busy, children: [
      /* @__PURE__ */ jsx(RefreshCw, { className: "mr-1.5 h-4 w-4", "aria-hidden": true }),
      t("customer_accounts.domainMapping.verifyNow", "Check Now")
    ] }) : null,
    showRetryTls ? /* @__PURE__ */ jsxs(Button, { type: "button", variant: "outline", size: "sm", onClick: onRetryTls, disabled: busy, children: [
      /* @__PURE__ */ jsx(RefreshCw, { className: "mr-1.5 h-4 w-4", "aria-hidden": true }),
      t("customer_accounts.domainMapping.tls.retryButton", "Retry SSL")
    ] }) : null,
    showTestDomain ? /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", size: "sm", asChild: true, children: /* @__PURE__ */ jsxs("a", { href: `https://${mapping.hostname}`, target: "_blank", rel: "noopener noreferrer", children: [
      /* @__PURE__ */ jsx(ExternalLink, { className: "mr-1.5 h-4 w-4", "aria-hidden": true }),
      t("customer_accounts.domainMapping.preview", "Test Domain")
    ] }) }) : null,
    showChangeDomain ? /* @__PURE__ */ jsxs(Button, { type: "button", variant: "outline", size: "sm", onClick: onChangeDomain, disabled: busy, children: [
      /* @__PURE__ */ jsx(Replace, { className: "mr-1.5 h-4 w-4", "aria-hidden": true }),
      t("customer_accounts.domainMapping.changeDomain", "Change Domain")
    ] }) : null,
    /* @__PURE__ */ jsxs(Button, { type: "button", variant: "outline", size: "sm", onClick: onRemove, disabled: busy, children: [
      /* @__PURE__ */ jsx(Trash2, { className: "mr-1.5 h-4 w-4", "aria-hidden": true }),
      t("customer_accounts.domainMapping.removeDomain", "Remove Domain")
    ] })
  ] });
}
var Actions_default = DefaultActions;
export {
  DefaultActions,
  Actions_default as default
};
//# sourceMappingURL=Actions.js.map
