1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-24 17:51:14 +02:00
unleash.unleash/frontend/src/component/feature/FeatureToggleList/FeatureStaleCell/FeatureStaleCell.tsx
Mateusz Kwasniewski 674e36b40b
Styled components batch4.1 (#2812)
Co-authored-by: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com>
2023-01-05 09:45:39 +01:00

42 lines
1.1 KiB
TypeScript

import { VFC } from 'react';
import { Box, styled, Theme, Typography } from '@mui/material';
import { ConditionallyRender } from '../../../common/ConditionallyRender/ConditionallyRender';
interface IFeatureStaleCellProps {
value?: boolean;
}
const staleStatus = (theme: Theme) => ({
color: theme.palette.error.dark,
fontSize: 'inherit',
});
const activeStatus = (theme: Theme) => ({
color: theme.palette.success.dark,
fontSize: 'inherit',
});
const StyledBox = styled(Box)(({ theme }) => ({
padding: theme.spacing(1.5, 2),
}));
export const FeatureStaleCell: VFC<IFeatureStaleCellProps> = ({ value }) => {
return (
<StyledBox>
<ConditionallyRender
condition={Boolean(value)}
show={
<Typography component="span" sx={staleStatus} data-loading>
Stale
</Typography>
}
elseShow={
<Typography component="span" sx={activeStatus} data-loading>
Active
</Typography>
}
/>
</StyledBox>
);
};