1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-16 00:06:40 +01:00
unleash.unleash/frontend/src/component/changeRequest/UpdateCount.tsx
andreas-unleash 3e9d88f789
Feat/scheduled cr UI tests (#5296)
Ui tests scheduled change requests

Closes # [1-1598](https://linear.app/unleash/issue/1-1598/e2e-ui-tests)

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2023-11-08 14:28:16 +02:00

40 lines
1.3 KiB
TypeScript

import { FC } from 'react';
import { Box, Typography } from '@mui/material';
import { ConditionallyRender } from '../common/ConditionallyRender/ConditionallyRender';
export const UpdateCount: FC<{
featuresCount: number;
segmentsCount: number;
}> = ({ featuresCount, segmentsCount }) => (
<Box component={'span'} sx={{ display: 'inline', pl: 0.5 }}>
<Typography
component='span'
variant='body2'
fontWeight='bold'
display='inline'
>
{featuresCount}{' '}
{featuresCount === 1 ? 'feature toggle' : 'feature toggles'}
</Typography>
<ConditionallyRender
condition={segmentsCount > 0}
show={
<>
<Typography component='span' variant='body2'>
{' and '}
</Typography>
<Typography
component='span'
variant='body2'
fontWeight='bold'
display='inline'
>
{segmentsCount}{' '}
{segmentsCount === 1 ? 'segment' : 'segments'}
</Typography>
</>
}
/>
</Box>
);