refactor: replace Toast with Sonner
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
import { useScriptWorkspaceStore } from "../platform/state/scriptWorkspaceStore";
|
||||
import { useUiStore } from "../platform/state/uiStore";
|
||||
import { toast } from "sonner";
|
||||
import SchedulePage from "./SchedulePage";
|
||||
|
||||
export default function SchedulesPageRoute() {
|
||||
const setApiOnline = useScriptWorkspaceStore((s) => s.setApiOnline);
|
||||
const pushToast = useUiStore((s) => s.pushToast);
|
||||
const pushToast = (notice: { tone: "success" | "error" | "info"; message: string }) => {
|
||||
if (notice.tone === "error") toast.error(notice.message);
|
||||
else if (notice.tone === "info") toast.info(notice.message);
|
||||
else toast.success(notice.message);
|
||||
};
|
||||
|
||||
return (
|
||||
<SchedulePage
|
||||
|
||||
Reference in New Issue
Block a user