✨ (template) Add FAQ bot template
This commit is contained in:
@ -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 }
|
||||
}
|
||||
|
Reference in New Issue
Block a user