Fix missing default cases in PreviewModal switch statements

Added default cases to getStatusColor() and getStatusIcon() functions
to prevent undefined returns. The functions now return sensible
fallback values ('text-gray-500' and '?' respectively) if an
unexpected status value is encountered.

This improves code robustness and prevents potential runtime errors.
This commit is contained in:
Claude 2026-01-17 21:30:26 +00:00
parent 8988349850
commit 30c14474b6
No known key found for this signature in database

View file

@ -36,6 +36,8 @@ export function PreviewModal({ open, onClose, code }: PreviewModalProps) {
return 'text-yellow-500';
case 'conflict':
return 'text-red-500';
default:
return 'text-gray-500';
}
};
@ -47,6 +49,8 @@ export function PreviewModal({ open, onClose, code }: PreviewModalProps) {
return '⚠';
case 'conflict':
return '✗';
default:
return '?';
}
};