pythonasyncioapiasyncfastapiframeworkjsonjson-schemaopenapiopenapi3pydanticpython-typespython3redocreststarletteswaggerswagger-uiuvicornweb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
484 B
21 lines
484 B
import { useCallback } from 'react';
|
|
|
|
import { useToast } from '@chakra-ui/react';
|
|
|
|
const useCustomToast = () => {
|
|
const toast = useToast();
|
|
|
|
const showToast = useCallback((title: string, description: string, status: 'success' | 'error') => {
|
|
toast({
|
|
title,
|
|
description,
|
|
status,
|
|
isClosable: true,
|
|
position: 'bottom-right'
|
|
});
|
|
}, [toast]);
|
|
|
|
return showToast;
|
|
};
|
|
|
|
export default useCustomToast;
|