mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-11-13 12:13:42 +01:00
13 lines
423 B
TypeScript
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],
|
|
);
|
|
}
|