feat: refactor folder refresh with toast notifications and console logging for toasts.
This commit is contained in:
@@ -43,6 +43,15 @@ export const StatusToastProvider: React.FC<{ children: React.ReactNode }> = ({ c
|
||||
}, []);
|
||||
|
||||
const showToast = useCallback((message: string, variant: ToastVariant = 'info', duration?: number) => {
|
||||
// Log to console based on variant
|
||||
if (variant === 'error') {
|
||||
console.error(`[Toast] ${message}`);
|
||||
} else if (variant === 'success') {
|
||||
console.log(`[Toast] ${message}`);
|
||||
} else {
|
||||
console.info(`[Toast] ${message}`);
|
||||
}
|
||||
|
||||
const id = `toast-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
||||
const finalDuration = duration ?? DEFAULT_DURATIONS[variant];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user