import type React from 'react'; import { useTheme, Typography } from '@mui/material'; import { styled } from '@mui/system'; import { Link } from 'react-router-dom'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; interface ProjectHealthProps { health: number; } const HealthContainer = styled('div')(({ theme }) => ({ backgroundColor: theme.palette.envAccordion.expanded, padding: theme.spacing(3), borderRadius: theme.shape.borderRadiusExtraLarge, minWidth: '300px', fontSize: theme.spacing(1.75), })); const ChartRow = styled('div')(({ theme }) => ({ display: 'flex', alignItems: 'center', })); const StyledSVG = styled('svg')({ width: 200, height: 100, }); const DescriptionText = styled(Typography)(({ theme }) => ({ color: theme.palette.text.secondary, })); export const ProjectHealth: React.FC = ({ health }) => { const { isOss } = useUiConfig(); const theme = useTheme(); const radius = 40; const strokeWidth = 13; const circumference = 2 * Math.PI * radius; const gapLength = 0.3; const filledLength = 1 - gapLength; const offset = 0.75 - gapLength / 2; const healthLength = (health / 100) * circumference * 0.7; return ( {health}% On average, your project health has remained at {health}% the last 4 weeks Remember to archive your stale feature flags to keep the project health growing {!isOss() && View health over time} ); };