import { deployPages, removePagesPreview, rollbackPages } from "~/fns/pages"; import { useAction } from "~/hooks/use-action"; import { Badge, EmptyState, formatBytes, Panel, RelativeTime } from "~/components/ui/Primitives"; import { Button } from "~/components/ui/Button"; import { ErrorBanner } from "~/components/ui/Field"; import type { PagesData } from "./PagesSettings"; type RepoParams = { owner: string; repo: string }; type Deployment = PagesData["deployments"][number]; const STATUS_TONES = { queued: "neutral", building: "amber", active: "green", failed: "red", superseded: "neutral", } as const; function DeploymentRow({ deployment, activeId, onRollback, onRemovePreview, }: { deployment: Deployment; activeId: string | null; onRollback: (id: string) => void; onRemovePreview: (prNumber: number) => void; }) { const live = deployment.status === "active"; const prNumber = deployment.prNumber; return (
{deployment.ref}@{deployment.sha.slice(0, 7)}
{deployment.source === "artifact" ? "artifact" : "branch"}
{deployment.fileCount > 0 && (
{deployment.fileCount} files, {formatBytes(deployment.totalBytes)}
)}
{deployment.error && {deployment.error}}