import { deployPages, removePagesPreview, rollbackPages } from "~/fns/pages"; import { useAction } from "~/hooks/use-action"; import { Badge } from "~/ui/Badge"; import { EmptyState } from "~/ui/EmptyState"; import { formatBytes } from "~/lib/format"; import { Panel } from "~/ui/Panel"; import { RelativeTime } from "~/ui/RelativeTime"; import { Button } from "~/ui/Button"; import { ErrorBanner } from "~/ui/Callout"; import type { PagesData } from "./PagesSettings"; import { ExternalLink } from "~/ui/TextLink"; type RepoParams = { owner: string; repo: string }; type Deployment = PagesData["deployments"][number]; const STATUS_TONES = { queued: "neutral", building: "warning", active: "success", failed: "danger", 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}}