import { formatDistanceToNow } from "date-fns"; import { HeartIcon } from "lucide-react"; import { OnOff } from "~/components/onoff"; import { Button } from "~/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "~/components/ui/card"; import type { Volume } from "~/lib/types"; type Props = { volume: Volume; }; export const HealthchecksCard = ({ volume }: Props) => { const timeAgo = formatDistanceToNow(volume.lastHealthCheck, { addSuffix: true, }); return ( Health Checks Monitor and automatically remount volumes on errors to ensure availability.
{volume.lastError && {volume.lastError}} {volume.status === "mounted" && Healthy} {volume.status !== "unmounted" && ( Checked {timeAgo || "never"} )} Remount on error {}} enabledLabel="Enabled" disabledLabel="Paused" />
{volume.status !== "unmounted" && (
)}
); };