31 lines
1.0 KiB
TypeScript
31 lines
1.0 KiB
TypeScript
import type { Snapshot } from "../../api";
|
|
import { formatBytes, formatWhen } from "../../lib/format";
|
|
import { Button } from "../ui/Button";
|
|
import { TelemetryPanel } from "../ui/Telemetry";
|
|
|
|
export function SnapshotSheet({
|
|
snap,
|
|
onReconstitute,
|
|
}: {
|
|
snap: Snapshot;
|
|
onReconstitute: () => void;
|
|
}) {
|
|
return (
|
|
<div className="space-y-4">
|
|
<p className="text-sm text-star-300">
|
|
Recovery point for <strong className="text-star-100">{snap.orbit_name}</strong>.
|
|
</p>
|
|
<div className="rounded-xl bg-space-800/60 p-3 border border-space-700 text-sm">
|
|
<p className="text-star-400 text-xs">Captured</p>
|
|
<p className="text-star-100 mt-1">{formatWhen(snap.taken_at)}</p>
|
|
<p className="text-star-400 text-xs mt-3">Payload</p>
|
|
<p className="text-star-100">{formatBytes(snap.size_bytes)}</p>
|
|
</div>
|
|
<Button variant="warn" className="w-full" onClick={onReconstitute}>
|
|
Restore this snapshot
|
|
</Button>
|
|
<TelemetryPanel label="Snapshot ID">{snap.id}</TelemetryPanel>
|
|
</div>
|
|
);
|
|
}
|