All files / components/migrations MigrationStatusBadge.tsx

100% Statements 1/1
100% Branches 9/9
100% Functions 1/1
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47                            97x                                                                
import { Badge } from '@/components/ui/badge';
import { Check, Clock, Star } from 'lucide-react';
 
interface MigrationStatusBadgeProps {
    isApplied: boolean;
    isHead: boolean;
    isCurrent?: boolean;
}
 
export default function MigrationStatusBadge({
    isApplied,
    isHead,
    isCurrent = false,
}: MigrationStatusBadgeProps) {
    return (
        <div className="flex gap-1">
            {isApplied && (
                <Badge
                    variant="default"
                    className={`bg-green-500 hover:bg-green-600 ${isCurrent ? 'ring-2 ring-green-700' : ''}`}
                >
                    <Check className="h-3 w-3 mr-1" />
                    Applied
                </Badge>
            )}
            {!isApplied && (
                <Badge
                    variant="secondary"
                    className="bg-yellow-500 hover:bg-yellow-600 text-white"
                >
                    <Clock className="h-3 w-3 mr-1" />
                    Pending
                </Badge>
            )}
            {isHead && (
                <Badge
                    variant="default"
                    className="bg-blue-500 hover:bg-blue-600"
                >
                    <Star className="h-3 w-3 mr-1" />
                    Head
                </Badge>
            )}
        </div>
    );
}