text: "use strict";
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.DeprecatedSuccessDialog = DeprecatedSuccessDialog;
  
  var _ui = require("@sanity/ui");
  
  var _react = require("react");
  
  function DeprecatedSuccessDialog(props) {
    var dialog = props.dialog;
    var content = dialog.content,
        onClose = dialog.onClose,
        title = dialog.title;
  
    var _useToast = (0, _ui.useToast)(),
        pushToast = _useToast.push;
  
    (0, _react.useEffect)(() => {
      pushToast({
        closable: true,
        status: 'success',
        title,
        description: content
      });
      setTimeout(onClose, 0);
    }, [content, onClose, pushToast, title]);
    (0, _react.useEffect)(() => {
      console.warn(['The "success" document action dialog is deprecated.', 'Use `useToast()` from @sanity/ui instead:', '```', 'import {useToast} from "@sanity/ui"', 'function MyDocumentAction () {\n  const toast = useToast()\n  useEffect(() => toast.push(...))\n}', '```'].join('\n\n'));
    }, []);
    return null;
  }