Add files via upload

This commit is contained in:
Michilis
2025-02-09 21:06:57 +01:00
committed by GitHub
parent 81d680e571
commit c899bac3fe
18 changed files with 1449 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import { useState, useCallback } from 'react';
export function useNotification() {
const [isVisible, setIsVisible] = useState(false);
const [message, setMessage] = useState('');
const [type, setType] = useState<'success' | 'error'>('success');
const showNotification = useCallback((text: string, notificationType: 'success' | 'error' = 'success') => {
setMessage(text);
setType(notificationType);
setIsVisible(true);
}, []);
const hideNotification = useCallback(() => {
setIsVisible(false);
}, []);
return {
isVisible,
message,
type,
showNotification,
hideNotification
};
}