import clsx from "clsx"; import styles from "./status-dot.module.css"; function capitalize(string: string = "") { return string.charAt(0).toUpperCase() + string.toLowerCase().slice(1); } const statusDotState = { QUEUED: "This deployment is queued.", BUILDING: "This deployment is building.", // building READY: "This deployment is ready.", ERROR: "This deployment had an error.", CANCELED: "This deployment was canceled.", INITIALIZING: "This deployment is initializing.", // building UPLOADING: "This deployment is uploading.", // building DEPLOYING: "This deployment is deploying.", // building ARCHIVED: "This deployment is archived.", } as const; export interface StatusDotProps { state: keyof typeof statusDotState; label?: boolean; } const StatusDot: React.FC = ({ state, label }) => { return ( {label && ( {capitalize(state)} )} ); }; export default StatusDot;