1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-06 00:07:44 +01:00
unleash.unleash/frontend/src/component/project/Project/ProjectOverview.tsx

43 lines
1.4 KiB
TypeScript
Raw Normal View History

2022-03-28 10:49:59 +02:00
import useProject from 'hooks/api/getters/useProject/useProject';
2022-02-28 17:20:47 +01:00
import { ProjectFeatureToggles } from './ProjectFeatureToggles/ProjectFeatureToggles';
import ProjectInfo from './ProjectInfo/ProjectInfo';
import { useStyles } from './Project.styles';
import { usePageTitle } from 'hooks/usePageTitle';
interface IProjectOverviewProps {
projectName: string;
projectId: string;
}
const ProjectOverview = ({ projectId, projectName }: IProjectOverviewProps) => {
const { project, loading } = useProject(projectId, {
refreshInterval: 15 * 1000, // ms
});
const { members, features, health, description, environments } = project;
const { classes: styles } = useStyles();
usePageTitle(`Project overview ${projectName}`);
return (
<div>
<div className={styles.containerStyles}>
<ProjectInfo
id={projectId}
description={description}
memberCount={members}
health={health}
featureCount={features?.length}
/>
<div className={styles.projectToggles}>
<ProjectFeatureToggles
features={features}
environments={environments}
loading={loading}
/>
</div>
</div>
</div>
);
};
export default ProjectOverview;