import { ProjectHealthChart } from './ProjectHealthChart'; import { Alert, Box, styled, Typography, useTheme } from '@mui/material'; import { Link } from 'react-router-dom'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; import type { ProjectInsightsSchemaHealth } from '../../../../../openapi'; import type { FC } from 'react'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; const Dot = styled('span', { shouldForwardProp: (prop) => prop !== 'color', })<{ color?: string }>(({ theme, color }) => ({ height: '15px', width: '15px', borderRadius: '50%', display: 'inline-block', backgroundColor: color, })); const FlagsCount = styled('p')(({ theme }) => ({ color: theme.palette.text.secondary, marginLeft: theme.spacing(3), })); const FlagCounts = styled(Box)(({ theme }) => ({ display: 'flex', flexDirection: 'column', gap: theme.spacing(2), })); const Container = styled(Box)(({ theme }) => ({ display: 'flex', flexDirection: 'column', gap: theme.spacing(2), })); const StatusWithDot = styled(Box)(({ theme }) => ({ display: 'flex', alignItems: 'center', gap: theme.spacing(1), })); export const ProjectHealth: FC<{ health: ProjectInsightsSchemaHealth }> = ({ health, }) => { const theme = useTheme(); const projectId = useRequiredPathParam('projectId'); const { staleCount, potentiallyStaleCount, activeCount, rating } = health; return ( Project Health 0} show={ Health alert! Review your flags and delete the stale flags } /> ({ display: 'flex', gap: theme.spacing(4), marginTop: theme.spacing(3), })} > Active {activeCount} feature flags Potentially stale (configure) {potentiallyStaleCount} feature flags Stale (view flags) {staleCount} feature flags ); };