Files
yaak-mountain-loop/apps/yaak-proxy/lib/toast.ts
T
2026-10-28 22:27:18 -07:00

13 lines
423 B
TypeScript

import { type ShowToastArgs, showToast } from "@yaakapp-internal/ui";
import { useStore } from "jotai";
import { useCallback } from "react";
/** Shows one of the client's toasts from this app's store, a success unless it says otherwise */
export function useShowToast() {
const store = useStore();
return useCallback(
(toast: ShowToastArgs) => showToast(store, { color: "success", ...toast }),
[store],
);
}