1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-06 00:07:44 +01:00
unleash.unleash/frontend/src/component/common/FeatureStatusChip/FeatureStatusChip.tsx

29 lines
642 B
TypeScript
Raw Normal View History

import { Badge } from 'component/common/Badge/Badge';
interface IStatusChip {
stale: boolean;
showActive?: boolean;
}
export const FeatureStatusChip = ({
stale,
showActive = true,
}: IStatusChip) => {
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' }}>
<Badge color={stale ? 'error' : 'success'} title={title}>
{value}
</Badge>
</div>
);
};