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

27 lines1,115 bytesCodeBlame

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Projects: what a workspace builds and runs, first on every page1/** 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" },
Builds say Replaced or Down once they are no longer live8 replaced: { label: "Replaced", tone: "text-faint" },
9 down: { label: "Down", tone: "text-faint" },
Projects: what a workspace builds and runs, first on every page10 failed: { label: "Failed", tone: "text-danger" },
11 skipped: { label: "Skipped", tone: "text-faint" },
12};
13
14export function StatusDot({ status, label }: { status: DeployStatus; label?: string }) {
15 const { label: word, tone } = DEPLOY_STATUS[status];
16 return (
17 <span className={`inline-flex items-center gap-1.5 text-xs font-medium ${tone}`}>
18 <span className={`size-1.5 rounded-full bg-current ${status === "building" || status === "queued" ? "animate-pulse" : ""}`} />
19 {label ?? word}
20 </span>
21 );
22}
23
24/** An address on g1t.page without its scheme. */
25export function host(url: string): string {
26 return url.replace(/^https?:\/\//, "");
27}