flagon-io/g1t

public

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t/apps/web/app/components/deploy.tsx

25 lines1,013 bytesCodeBlame
1/** Small pieces every page about deployments shares. */
2import type { DeployStatus } from "@g1t/contracts";
3
4export const DEPLOY_STATUS: Record<DeployStatus, { label: string; tone: string }> = {
5 queued: { label: "Queued", tone: "text-muted" },
6 building: { label: "Building", tone: "text-warn" },
7 ready: { label: "Live", tone: "text-accent" },
8 failed: { label: "Failed", tone: "text-danger" },
9 skipped: { label: "Skipped", tone: "text-faint" },
10};
11
12export function StatusDot({ status, label }: { status: DeployStatus; label?: string }) {
13 const { label: word, tone } = DEPLOY_STATUS[status];
14 return (
15 <span className={`inline-flex items-center gap-1.5 text-xs font-medium ${tone}`}>
16 <span className={`size-1.5 rounded-full bg-current ${status === "building" || status === "queued" ? "animate-pulse" : ""}`} />
17 {label ?? word}
18 </span>
19 );
20}
21
22/** An address on g1t.page without its scheme. */
23export function host(url: string): string {
24 return url.replace(/^https?:\/\//, "");
25}