feat: initial public release (MAESTRO)

This commit is contained in:
oss-sync
2026-06-03 05:08:00 +00:00
commit f5c7666f6b
823 changed files with 184150 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import { useState, useEffect, useCallback } from 'react';
export type ToastVariant = 'success' | 'error';
export interface ToastState {
message: string;
variant: ToastVariant;
}
export function useToast(durationMs = 3500) {
const [state, setState] = useState<ToastState | null>(null);
useEffect(() => {
if (!state) return;
const id = setTimeout(() => setState(null), durationMs);
return () => clearTimeout(id);
}, [state, durationMs]);
const showToast = useCallback((message: string, variant: ToastVariant = 'success') => {
setState({ message, variant });
}, []);
return { toast: state, showToast };
}