mirror of
https://github.com/wanderer-industries/wanderer
synced 2025-11-29 12:33:22 +00:00
29 lines
591 B
TypeScript
29 lines
591 B
TypeScript
import { Toast } from 'primereact/toast';
|
|
|
|
export const callToastWarn = (toast: Toast | null, msg: string, life = 3000) => {
|
|
toast?.show({
|
|
severity: 'warn',
|
|
summary: 'Warning',
|
|
detail: msg,
|
|
life,
|
|
});
|
|
};
|
|
|
|
export const callToastError = (toast: Toast | null, msg: string, life = 3000) => {
|
|
toast?.show({
|
|
severity: 'error',
|
|
summary: 'Error',
|
|
detail: msg,
|
|
life,
|
|
});
|
|
};
|
|
|
|
export const callToastSuccess = (toast: Toast | null, msg: string, life = 3000) => {
|
|
toast?.show({
|
|
severity: 'success',
|
|
summary: 'Success',
|
|
detail: msg,
|
|
life,
|
|
});
|
|
};
|