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:
parent
8988349850
commit
30c14474b6
1 changed files with 4 additions and 0 deletions
|
|
@ -36,6 +36,8 @@ export function PreviewModal({ open, onClose, code }: PreviewModalProps) {
|
||||||
return 'text-yellow-500';
|
return 'text-yellow-500';
|
||||||
case 'conflict':
|
case 'conflict':
|
||||||
return 'text-red-500';
|
return 'text-red-500';
|
||||||
|
default:
|
||||||
|
return 'text-gray-500';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -47,6 +49,8 @@ export function PreviewModal({ open, onClose, code }: PreviewModalProps) {
|
||||||
return '⚠';
|
return '⚠';
|
||||||
case 'conflict':
|
case 'conflict':
|
||||||
return '✗';
|
return '✗';
|
||||||
|
default:
|
||||||
|
return '?';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue