2023-03-06 11:58:36 +01:00
|
|
|
import { Badge } from 'component/common/Badge/Badge';
|
2021-11-12 11:47:19 +01:00
|
|
|
|
|
|
|
interface IStatusChip {
|
|
|
|
stale: boolean;
|
2022-05-02 12:52:33 +02:00
|
|
|
showActive?: boolean;
|
2021-11-12 11:47:19 +01:00
|
|
|
}
|
|
|
|
|
2022-11-02 16:05:27 +01:00
|
|
|
export const FeatureStatusChip = ({
|
|
|
|
stale,
|
|
|
|
showActive = true,
|
|
|
|
}: IStatusChip) => {
|
2021-11-12 11:47:19 +01:00
|
|
|
if (!stale && !showActive) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
const title = stale
|
|
|
|
? 'Feature toggle is deprecated.'
|
|
|
|
: 'Feature toggle is active.';
|
|
|
|
const value = stale ? 'Stale' : 'Active';
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div data-loading style={{ marginLeft: '8px' }}>
|
2023-03-22 15:37:40 +01:00
|
|
|
<Badge color={stale ? 'error' : 'success'} title={title}>
|
2023-03-06 11:58:36 +01:00
|
|
|
{value}
|
|
|
|
</Badge>
|
2021-11-12 11:47:19 +01:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|