🛂 Migrate to Chakra UI v3 (#1496)

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Alejandra
2025-02-17 19:33:00 +00:00
committed by GitHub
parent 74e2604faf
commit 55df823739
60 changed files with 4682 additions and 4399 deletions

View File

@@ -1,23 +1,25 @@
import { useToast } from "@chakra-ui/react"
import { useCallback } from "react"
"use client"
import { toaster } from "../components/ui/toaster"
const useCustomToast = () => {
const toast = useToast()
const showSuccessToast = (description: string) => {
toaster.create({
title: "Success!",
description,
type: "success",
})
}
const showToast = useCallback(
(title: string, description: string, status: "success" | "error") => {
toast({
title,
description,
status,
isClosable: true,
position: "bottom-right",
})
},
[toast],
)
const showErrorToast = (description: string) => {
toaster.create({
title: "Something went wrong!",
description,
type: "error",
})
}
return showToast
return { showSuccessToast, showErrorToast }
}
export default useCustomToast