import { Toast, showHUD, showToast } from "@vicinae/api"; import { toggleCaffeination } from "./lib/caffeinate"; export default async function ToggleCaffeination() { try { const result = await toggleCaffeination(); await showHUD(result === "stopped" ? "☕ Sleep is allowed again" : "☕ Staying awake"); } catch (error) { await showToast({ style: Toast.Style.Failure, title: "Could not change caffeination", message: error instanceof Error ? error.message : String(error), }); } }