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:
parent
1ab7b9096a
commit
1cd9d3ffee
@ -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}`,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user