1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-11-24 20:06:55 +01:00

feat: remove ts-ignore

This commit is contained in:
Thomas Heartman 2024-01-11 18:31:29 +05:30
parent 1ab7b9096a
commit 1cd9d3ffee
No known key found for this signature in database
GPG Key ID: BD1F880DAED1EE78

View File

@ -66,32 +66,30 @@ export const ChangeRequestStatusBadge: VFC<IChangeRequestStatusBadgeProps> = ({
).toLocaleString();
const { color, icon, tooltipTitle } = (() => {
switch (schedule!.status) {
case 'pending':
return {
color: 'warning' as const,
icon: <AccessTime fontSize={'small'} />,
tooltipTitle: `Scheduled for ${scheduledAt}`,
};
switch (schedule?.status) {
case 'failed':
return {
color: 'error' as const,
icon: <ErrorIcon fontSize={'small'} />,
tooltipTitle: `Failed on ${scheduledAt} because of ${
// @ts-ignore
schedule!.reason ?? schedule!.failureReason
}`,
};
// @ts-ignore
case 'suspended':
return {
color: 'disabled' as const,
icon: <PauseCircle fontSize={'small'} />,
tooltipTitle: `Suspended because: ${
// @ts-ignore
schedule!.reason
}`,
};
case 'pending':
default:
return {
color: 'warning' as const,
icon: <AccessTime fontSize={'small'} />,
tooltipTitle: `Scheduled for ${scheduledAt}`,
};
}
})();