fix build client package

This commit is contained in:
Marco Beretta 2025-07-10 23:45:52 +02:00
parent 9f270127d3
commit 0b7dd55797
No known key found for this signature in database
GPG key ID: D918033D8E74CC11
22 changed files with 148 additions and 565 deletions

View file

@ -1,11 +1,11 @@
import { useRecoilState } from 'recoil';
import { useAtom } from 'jotai';
import { useRef, useEffect } from 'react';
import type { TShowToast } from '~/common';
import { NotificationSeverity } from '~/common';
import store from '~/store';
import { toastState, type ToastState } from '~/store';
export default function useToast(showDelay = 100) {
const [toast, setToast] = useRecoilState(store.toastState);
const [toast, setToast] = useAtom(toastState);
const showTimerRef = useRef<number | null>(null);
const hideTimerRef = useRef<number | null>(null);
@ -45,7 +45,7 @@ export default function useToast(showDelay = 100) {
});
// Hides the toast after the specified duration
hideTimerRef.current = window.setTimeout(() => {
setToast((prevToast) => ({ ...prevToast, open: false }));
setToast((prevToast: ToastState) => ({ ...prevToast, open: false }));
}, duration);
}, showDelay);
};