MCPcopy Create free account
hub / github.com/codeaashu/claude-code / useToast

Function useToast

web/hooks/useToast.ts:15–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13}
14
15export function useToast() {
16 const addToast = useNotificationStore((s) => s.addToast);
17 const dismissToast = useNotificationStore((s) => s.dismissToast);
18 const dismissAllToasts = useNotificationStore((s) => s.dismissAllToasts);
19
20 const toast = useCallback(
21 (options: ToastOptions): string => {
22 const duration = options.duration ?? DEFAULT_DURATIONS[options.variant];
23 return addToast({ ...options, duration });
24 },
25 [addToast]
26 );
27
28 return { toast, dismiss: dismissToast, dismissAll: dismissAllToasts };
29}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected