mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 17:30:16 +01:00
feat(client): Toast Provider to show Toasts from higher on the DOM tree (#1110)
This commit is contained in:
parent
81a90d245b
commit
5cafe0900c
5 changed files with 34 additions and 11 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { useRef, useEffect } from 'react';
|
||||
import { useRecoilState } from 'recoil';
|
||||
import { useRef, useEffect } from 'react';
|
||||
import type { TShowToast } from '~/common';
|
||||
import { NotificationSeverity } from '~/common';
|
||||
import store from '~/store';
|
||||
|
||||
|
|
@ -15,12 +16,6 @@ export default function useToast(timeoutDuration = 100) {
|
|||
};
|
||||
}, []);
|
||||
|
||||
type TShowToast = {
|
||||
message: string;
|
||||
severity?: NotificationSeverity;
|
||||
showIcon?: boolean;
|
||||
};
|
||||
|
||||
const showToast = ({
|
||||
message,
|
||||
severity = NotificationSeverity.SUCCESS,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue