2
0

(template) Add FAQ bot template

This commit is contained in:
Baptiste Arnaud
2022-10-13 08:42:24 +02:00
parent 40d2db59dc
commit b87ba4023d
4 changed files with 603 additions and 27 deletions

View File

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