21 lines
373 B
TypeScript
21 lines
373 B
TypeScript
![]() |
import { useToast as useChakraToast, UseToastOptions } from '@chakra-ui/toast'
|
||
|
|
||
|
export const useToast = () => {
|
||
|
const toast = useChakraToast()
|
||
|
|
||
|
const showToast = ({
|
||
|
title,
|
||
|
description,
|
||
|
status = 'error',
|
||
|
}: UseToastOptions) => {
|
||
|
toast({
|
||
|
position: 'bottom-right',
|
||
|
description,
|
||
|
title,
|
||
|
status,
|
||
|
})
|
||
|
}
|
||
|
|
||
|
return { showToast }
|
||
|
}
|