import React, { useEffect } from 'react';
import { notification } from 'antd';
export default function Render(props) {
    const { data, } = props.data;
    const [notificationApi, contextHolder] = notification.useNotification();
    useEffect(() => {
        if (data) {
            const args = {
                ...data,
                duration: data.duration ?? undefined,
            };
            if (data.type) {
                notificationApi[data.type](args);
            }
            else {
                notificationApi.open(args);
            }
        }
    }, [data]);
    return <>{contextHolder}</>;
}
