import Box from '../../box';
import Button from '../../button';
import ConfigProvider from '../../config-provider';
import Dialog from '..';
import React from 'react';
import ReactDOM from 'react-dom';
const popupAlert = () => {
    Dialog.alert({
        title: 'Alert',
        content: 'alert content alert content...',
        okProps: { children: 'Custom OK' },
        cancelProps: { children: 'Custom cancel' },
        onOk: () => console.log('alert ok'),
    });
};
const popupConfirm = () => {
    Dialog.confirm({
        title: 'Confirm',
        content: 'confirm content confirm content...',
        locale: {
            ok: '这是确定',
            cancel: '这是取消',
        },
        onOk: () => console.log('confirm ok'),
        onCancel: () => console.log('confirm cancel'),
    });
};
const popupShow = () => {
    const dialog = Dialog.show({
        title: 'Custom',
        content: 'custom content custom content...',
        footer: (React.createElement(Button, { warning: true, type: "primary", onClick: () => dialog.hide() }, "Custom button")),
    });
};
const popupCustomIcon = () => {
    Dialog.confirm({
        title: 'Confirm',
        content: 'set icon as "warning" ',
        messageProps: {
            type: 'warning',
        },
        onOk: () => console.log('ok'),
        onCancel: () => console.log('cancel'),
    });
};
ReactDOM.render(React.createElement(ConfigProvider, { locale: { Dialog: { ok: 'OK', cancel: 'Cancel' } } },
    React.createElement(Box, { direction: "row", spacing: 20 },
        React.createElement(Button, { onClick: popupAlert }, "Alert"),
        React.createElement(Button, { onClick: popupConfirm }, "Confirm"),
        React.createElement(Button, { onClick: popupShow }, "Show"),
        React.createElement(Button, { onClick: popupCustomIcon }, "Custom Icon"))), document.getElementById('dialog-demo-2'));
