mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
Updae theme and fix some bug (#1711)
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
import { useToast as uToast, UseToastOptions } from '@chakra-ui/react';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
|
||||
export const useToast = (props?: UseToastOptions) => {
|
||||
const toast = uToast({
|
||||
position: 'top',
|
||||
duration: 2000,
|
||||
...props
|
||||
});
|
||||
|
||||
const myToast = useCallback(
|
||||
(options?: UseToastOptions) => {
|
||||
if (options?.title || options?.description) {
|
||||
toast(options);
|
||||
}
|
||||
},
|
||||
[props]
|
||||
);
|
||||
|
||||
return {
|
||||
toast: myToast
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user