2024-03-18 13:58:05 +01:00
|
|
|
import type { FC } from 'react';
|
2023-08-11 14:59:59 +02:00
|
|
|
import { Box, Typography } from '@mui/material';
|
|
|
|
import { ConditionallyRender } from '../common/ConditionallyRender/ConditionallyRender';
|
|
|
|
|
|
|
|
export const UpdateCount: FC<{
|
|
|
|
featuresCount: number;
|
|
|
|
segmentsCount: number;
|
|
|
|
}> = ({ featuresCount, segmentsCount }) => (
|
2023-11-08 13:28:16 +01:00
|
|
|
<Box component={'span'} sx={{ display: 'inline', pl: 0.5 }}>
|
2023-08-11 14:59:59 +02:00
|
|
|
<Typography
|
2023-10-02 14:25:46 +02:00
|
|
|
component='span'
|
|
|
|
variant='body2'
|
|
|
|
fontWeight='bold'
|
|
|
|
display='inline'
|
2023-08-11 14:59:59 +02:00
|
|
|
>
|
|
|
|
{featuresCount}{' '}
|
|
|
|
{featuresCount === 1 ? 'feature toggle' : 'feature toggles'}
|
|
|
|
</Typography>
|
|
|
|
<ConditionallyRender
|
|
|
|
condition={segmentsCount > 0}
|
|
|
|
show={
|
|
|
|
<>
|
2023-10-02 14:25:46 +02:00
|
|
|
<Typography component='span' variant='body2'>
|
2023-08-11 14:59:59 +02:00
|
|
|
{' and '}
|
|
|
|
</Typography>
|
|
|
|
<Typography
|
2023-10-02 14:25:46 +02:00
|
|
|
component='span'
|
|
|
|
variant='body2'
|
|
|
|
fontWeight='bold'
|
|
|
|
display='inline'
|
2023-08-11 14:59:59 +02:00
|
|
|
>
|
|
|
|
{segmentsCount}{' '}
|
|
|
|
{segmentsCount === 1 ? 'segment' : 'segments'}
|
|
|
|
</Typography>
|
|
|
|
</>
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
</Box>
|
|
|
|
);
|