feat: add tooltip if user's anthropic trial quota still available (#13418)

This commit is contained in:
NFish
2025-02-10 10:44:20 +08:00
committed by GitHub
parent 7796984444
commit 2290f14fb1
5 changed files with 38 additions and 2 deletions

View File

@@ -122,7 +122,8 @@ Toast.notify = ({
duration,
className,
customComponent,
}: Pick<IToastProps, 'type' | 'size' | 'message' | 'duration' | 'className' | 'customComponent'>) => {
onClose,
}: Pick<IToastProps, 'type' | 'size' | 'message' | 'duration' | 'className' | 'customComponent' | 'onClose'>) => {
const defaultDuring = (type === 'success' || type === 'info') ? 3000 : 6000
if (typeof window === 'object') {
const holder = document.createElement('div')
@@ -130,12 +131,13 @@ Toast.notify = ({
root.render(
<ToastContext.Provider value={{
notify: () => {},
notify: () => { },
close: () => {
if (holder) {
root.unmount()
holder.remove()
}
onClose?.()
},
}}>
<Toast type={type} size={size} message={message} duration={duration} className={className} customComponent={customComponent} />
@@ -147,6 +149,7 @@ Toast.notify = ({
root.unmount()
holder.remove()
}
onClose?.()
}, duration || defaultDuring)
}
}