ConceptPortal-public/rsconcept/frontend/src/app/GlobalToaster.tsx

11 lines
415 B
TypeScript
Raw Normal View History

2023-07-25 20:27:29 +03:00
import { ToastContainer, type ToastContainerProps } from 'react-toastify';
import { usePreferencesStore } from '@/stores/preferences';
2023-12-28 14:04:44 +03:00
interface ToasterThemedProps extends Omit<ToastContainerProps, 'theme'> {}
2025-02-15 17:11:36 +03:00
export function ToasterThemed(props: ToasterThemedProps) {
const darkMode = usePreferencesStore(state => state.darkMode);
2023-12-28 14:04:44 +03:00
return <ToastContainer theme={darkMode ? 'dark' : 'light'} {...props} />;
}