import { invoke } from "@tauri-apps/api/core";
import { platform } from "@tauri-apps/plugin-os";

export async function sendWSLNotification(title: string, body: string): Promise<void> {
  const currentPlatform = await platform();

  // Check if we're on Windows (WSL shows as 'windows')
  if (currentPlatform === "windows") {
    try {
      // Use PowerShell to send Windows native notifications
      await invoke("send_windows_notification", { title, body });
    } catch (error) {
      console.error("Failed to send Windows notification:", error);
    }
  }
}
