add toast to scaffold
This commit is contained in:
17
scaffold/src/utils/toast.ts
Normal file
17
scaffold/src/utils/toast.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import { toast } from "sonner";
|
||||||
|
|
||||||
|
export const showSuccess = (message: string) => {
|
||||||
|
toast.success(message);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const showError = (message: string) => {
|
||||||
|
toast.error(message);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const showLoading = (message: string) => {
|
||||||
|
return toast.loading(message);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const dismissToast = (toastId: string) => {
|
||||||
|
toast.dismiss(toastId);
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user