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