Added deployments overview
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
import { CheckCircle2, Clock, Loader2, XCircle } from 'lucide-react';
|
||||
import type { DeploymentStatus } from '../api/types/deployments';
|
||||
import { cn } from '../lib/utils';
|
||||
|
||||
const StatusIcon = ({ status }: { status: DeploymentStatus }) => {
|
||||
switch (status) {
|
||||
case 'success':
|
||||
return <CheckCircle2 className="w-4 h-4 text-success" />;
|
||||
case 'failed':
|
||||
return <XCircle className="w-4 h-4 text-destructive" />;
|
||||
case 'running':
|
||||
return <Loader2 className="w-4 h-4 text-primary animate-spin" />;
|
||||
case 'pending':
|
||||
return <Clock className="w-4 h-4 text-muted-foreground" />;
|
||||
}
|
||||
};
|
||||
|
||||
const DeploymentStatusBadge = ({ status }: { status: DeploymentStatus }) => {
|
||||
const statusText = status.charAt(0).toUpperCase() + status.slice(1);
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-2">
|
||||
<StatusIcon status={status} />
|
||||
<span
|
||||
className={cn(
|
||||
'text-sm capitalize hidden sm:inline',
|
||||
status === 'success' && 'text-success',
|
||||
status === 'failed' && 'text-destructive',
|
||||
status === 'running' && 'text-primary',
|
||||
status === 'pending' && 'text-muted-foreground'
|
||||
)}
|
||||
>
|
||||
{statusText}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default DeploymentStatusBadge;
|
||||
Reference in New Issue
Block a user