mirror of
https://github.com/datahub-project/datahub.git
synced 2025-10-02 04:26:21 +00:00
19 lines
391 B
TypeScript
19 lines
391 B
TypeScript
import { message } from 'antd';
|
|
import { ReactNode } from 'react';
|
|
|
|
export enum ToastType {
|
|
INFO = 'info',
|
|
ERROR = 'error',
|
|
SUCCESS = 'success',
|
|
WARNING = 'warning',
|
|
LOADING = 'loading',
|
|
}
|
|
|
|
export const showToastMessage = (type: ToastType, content: string | ReactNode, duration: number) => {
|
|
message.open({
|
|
type,
|
|
content,
|
|
duration,
|
|
});
|
|
};
|