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

22 lines
470 B
TypeScript
Raw Normal View History

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