2
0
Files
bot/apps/builder/components/shared/hooks/useToast.tsx

23 lines
402 B
TypeScript
Raw Normal View History

2022-08-08 08:21:36 +02:00
import { useToast as useChakraToast, UseToastOptions } from '@chakra-ui/react'
2022-06-02 07:54:48 +02:00
export const useToast = () => {
const toast = useChakraToast()
const showToast = ({
title,
description,
status = 'error',
...props
2022-06-02 07:54:48 +02:00
}: UseToastOptions) => {
toast({
position: 'bottom-right',
description,
title,
status,
...props,
2022-06-02 07:54:48 +02:00
})
}
return { showToast }
}