import {invoke} from "@tauri-apps/api/core"; import {toast} from "sonner"; export async function invokeCommand(command: string, data?: Record): Promise { try { return await invoke(command, data); } catch (e) { toast.error(e as unknown as string); throw e; } }