'use client';

// src/components/Toast/components/ActionButton.tsx
import { cn } from "@paalan/react-shared/lib";

// src/components/Toast/helper.ts
import React from "react";
var isValidReactNode = (value) => {
  return typeof value === "string" || React.isValidElement(value);
};

// src/components/Toast/components/ActionButton.tsx
import { jsx } from "react/jsx-runtime";
var ActionButton = ({ toast, deleteToast, className }) => {
  if (isValidReactNode(toast.action)) return toast.action;
  const onClick = toast.action.onClick;
  return /* @__PURE__ */ jsx(
    "button",
    {
      "data-button": true,
      onClick: (event) => {
        onClick?.(event);
        if (event.defaultPrevented) return;
        deleteToast();
      },
      className: cn(className, toast.action.className),
      children: toast.action.label
    }
  );
};
export {
  ActionButton
};
