'use client';

// src/components/Toast/components/CancelButton.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/CancelButton.tsx
import { jsx } from "react/jsx-runtime";
var CancelButton = ({ toast, dismissible, deleteToast, className }) => {
  if (isValidReactNode(toast.cancel)) return toast.cancel;
  const onClick = toast.cancel.onClick;
  return /* @__PURE__ */ jsx(
    "button",
    {
      "data-button": true,
      "data-cancel": true,
      onClick: () => {
        if (!dismissible) return;
        deleteToast();
        onClick?.();
      },
      className: cn(className, toast.cancel.className),
      children: toast.cancel.label
    }
  );
};
export {
  CancelButton
};
