pythonasyncioapiasyncfastapiframeworkjsonjson-schemaopenapiopenapi3pydanticpython-typespython3redocreststarletteswaggerswagger-uiuvicornweb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
578 B
28 lines
578 B
"use client"
|
|
|
|
import { useTranslation } from "react-i18next"
|
|
import { toaster } from "@/components/ui/toaster"
|
|
|
|
const useCustomToast = () => {
|
|
const { t } = useTranslation()
|
|
|
|
const showSuccessToast = (description: string) => {
|
|
toaster.create({
|
|
title: t("common.success"),
|
|
description,
|
|
type: "success",
|
|
})
|
|
}
|
|
|
|
const showErrorToast = (description: string) => {
|
|
toaster.create({
|
|
title: t("common.error"),
|
|
description,
|
|
type: "error",
|
|
})
|
|
}
|
|
|
|
return { showSuccessToast, showErrorToast }
|
|
}
|
|
|
|
export default useCustomToast
|
|
|