Spaces:
Build error
Build error
File size: 512 Bytes
0bfe2e3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
import { toast, ToastOptions } from 'react-toastify';
export const toastOptions: ToastOptions = {
autoClose: 5000,
hideProgressBar: true,
closeOnClick: false,
pauseOnHover: true,
draggable: 'touch',
style: {
borderRadius: '8px',
backgroundColor: '#ededed',
color: 'black',
},
};
function showToast(
message: string,
type: 'success' | 'error' | 'info' | 'warning',
id?: string
) {
toast[type](message, {
...toastOptions,
toastId: id,
});
}
export default showToast;
|