2
0
Files
bot/apps/builder/components/shared/hooks/useToast.tsx
2022-10-13 08:42:24 +02:00

22 lines
470 B
TypeScript

import { useToast as useChakraToast, UseToastOptions } from '@chakra-ui/react'
import { useCallback } from 'react'
export const useToast = () => {
const toast = useChakraToast()
const showToast = useCallback(
({ title, description, status = 'error', ...props }: UseToastOptions) => {
toast({
position: 'bottom-right',
description,
title,
status,
...props,
})
},
[toast]
)
return { showToast }
}