Files
score/frontend/src/hooks/useCustomToast.ts
Alejandra 55df823739 🛂 Migrate to Chakra UI v3 (#1496)
Co-authored-by: github-actions <github-actions@github.com>
2025-02-17 20:33:00 +01:00

26 lines
493 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