mirror of
https://github.com/RYDE-WORK/full-stack-fastapi-template.git
synced 2026-01-19 13:13:25 +08:00
26 lines
492 B
TypeScript
26 lines
492 B
TypeScript
"use client"
|
|
|
|
import { toaster } from "@/components/ui/toaster"
|
|
|
|
const useCustomToast = () => {
|
|
const showSuccessToast = (description: string) => {
|
|
toaster.create({
|
|
title: "Success!",
|
|
description,
|
|
type: "success",
|
|
})
|
|
}
|
|
|
|
const showErrorToast = (description: string) => {
|
|
toaster.create({
|
|
title: "Something went wrong!",
|
|
description,
|
|
type: "error",
|
|
})
|
|
}
|
|
|
|
return { showSuccessToast, showErrorToast }
|
|
}
|
|
|
|
export default useCustomToast
|