"use client"; // THE DRIVE BANNER (lane drive-stall): one card per storage location whose // drive is not answering, slow, or not mounted with channels on it — the // dashboard's top slot, beside the cookie banners. Not answering and not // mounted are different troubles with different fixes, so they read // differently: a drive that is here and stalled (a USB enclosure resetting) // is waited out, or unplugged and replugged; a drive that is not mounted is // mounted. The words come from the server (lib/storageHealth.ts // `driveHealthView`), so /storage and this banner cannot disagree. import Link from "next/link"; import type { DriveHealthBannerRow, DriveHealthPayload, } from "../../storage/lib/driveHealth"; const HEADLINE: Record, string> = { stalled: "is not answering", slow: "is answering slowly", unmounted: "is not mounted", }; const WHAT_HAPPENS: Record, string> = { stalled: "Pages and polls skip it and its channels' jobs are held until it answers again; nothing else in the editor waits on it.", slow: "Everything still runs; reads on it take longer than they should.", unmounted: "Its channels' jobs are held until it is back.", }; function DriveCard({ drive }: { drive: DriveHealthBannerRow }) { if (drive.state === "ok") return null; const severe = drive.state !== "slow"; return (

The media drive {drive.label} {HEADLINE[drive.state]}

{drive.text}

{WHAT_HAPPENS[drive.state]} {" · "} Storage {drive.channels > 0 && ( <> {" · "} {drive.channels} channel(s) on it )}

); } export function DriveHealthBanner({ data }: { data: DriveHealthPayload }) { if (data.drives.length === 0) return null; return (
{data.drives.map((d) => ( ))}
); }