import type { ServiceStatus } from "@batch-cooking/shared";

/**
 * Pure helpers for `MonitoringPage` — kept out of the `.tsx` per repo
 * convention.
 */

/** CSS modifier suffix for a status pill (`monitoring-card--up`, etc.). */
export function statusModifier(status: ServiceStatus): string {
  return status;
}

/** How often the board re-polls `GET /admin/monitoring`, in ms. */
export const POLL_INTERVAL_MS = 15_000;

/** `"2026-08-28T09:00:00.000Z"` → `"09:00:00"` (local time) for the "last checked" line. */
export function clockTime(iso: string): string {
  return new Date(iso).toLocaleTimeString("fr-FR");
}
