1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-06 00:07:44 +01:00
unleash.unleash/frontend/src/component/changeRequest/UpdateCount.tsx
Christopher Kolstad 53354224fc
chore: Bump biome and configure husky (#6589)
Upgrades biome to 1.6.1, and updates husky pre-commit hook.

Most changes here are making type imports explicit.
2024-03-18 13:58:05 +01:00

40 lines
1.3 KiB
TypeScript

import type { 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>
);