MCPcopy
hub / github.com/fastapi/full-stack-fastapi-template / useCustomToast

Function useCustomToast

frontend/src/hooks/useCustomToast.ts:3–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import { toast } from "sonner"
2
3const useCustomToast = () => {
4 const showSuccessToast = (description: string) => {
5 toast.success("Success!", {
6 description,
7 })
8 }
9
10 const showErrorToast = (description: string) => {
11 toast.error("Something went wrong!", {
12 description,
13 })
14 }
15
16 return { showSuccessToast, showErrorToast }
17}
18
19export default useCustomToast

Callers 12

DeleteConfirmationFunction · 0.85
UserInformationFunction · 0.85
ChangePasswordFunction · 0.85
EditUserFunction · 0.85
DeleteUserFunction · 0.85
AddUserFunction · 0.85
AddItemFunction · 0.85
DeleteItemFunction · 0.85
EditItemFunction · 0.85
RecoverPasswordFunction · 0.85
ResetPasswordFunction · 0.85
useAuthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected