import { formatDistanceToNow } from "date-fns"; import { ScanHeartIcon } from "lucide-react"; import type { GetVolumeResponse } from "~/api-client"; import { Button } from "~/components/ui/button"; import { Card } from "~/components/ui/card"; import { Switch } from "~/components/ui/switch"; type Props = { volume: GetVolumeResponse; }; export const HealthchecksCard = ({ volume }: Props) => { const timeAgo = formatDistanceToNow(volume.lastHealthCheck, { addSuffix: true, }); return (

Health Checks

{volume.lastError && {volume.lastError}} {volume.status === "mounted" && Healthy} {volume.status !== "unmounted" && ( Checked {timeAgo || "never"} )} Remount on error
); };