SurfSense/surfsense_obsidian/src/status-visuals.ts
Anish Sarkar 937965b335 feat: improve status handling and user feedback in SurfSense plugin
- Added refreshStatus method to update connection status immediately after settings changes.
- Enhanced error reporting with reportAuthError method for better authentication feedback.
- Updated status visuals in the status modal to reflect the new centralized structure.
- Improved connection handling in the settings tab to ensure accurate status representation.
2026-04-25 03:24:17 +05:30

18 lines
757 B
TypeScript

import type { StatusKind } from "./types";
/** Shared by the status bar and the settings "Connection" heading. */
export interface StatusVisual {
icon: string;
label: string;
isError: boolean;
}
export const STATUS_VISUALS: Record<StatusKind, StatusVisual> = {
idle: { icon: "check-circle", label: "Synced", isError: false },
syncing: { icon: "refresh-ccw", label: "Syncing", isError: false },
queued: { icon: "clock", label: "Queued", isError: false },
"needs-setup": { icon: "cloud-off", label: "Setup required", isError: false },
offline: { icon: "wifi-off", label: "Offline", isError: false },
"auth-error": { icon: "alert-circle", label: "Reauthenticate", isError: true },
error: { icon: "alert-circle", label: "Error", isError: true },
};