| 20 | const failureText = (error: unknown) => error instanceof Error ? error.message : String(error); |
| 21 | const booleanText = (value: string | null | undefined) => value === 'true' ? 'On' : value === 'false' ? 'Off' : 'Unknown'; |
| 22 | const watcherText = (health: ProjectHealth | null, failed: boolean) => { |
| 23 | if (failed || health?.watchRegistered == null || health.watcherRunning == null) return 'Unknown'; |
| 24 | return health.watchRegistered ? health.watcherRunning ? 'Active' : 'Registered · daemon watcher stopped' : 'Not registered'; |
| 25 | }; |
| 26 | |
| 27 | function WatcherSetting({ api, active, paused, pollMs, refreshToken }: Omit<Props, 'listProjects' | 'onOpenProjects'> & { pollMs: number }) { |
| 28 | const [snapshot, setSnapshot] = useState<ConfigSnapshot | null>(null); |