2021-10-01 12:15:02 +02:00
|
|
|
import useProject from '../../../hooks/api/getters/useProject/useProject';
|
2022-02-28 17:20:47 +01:00
|
|
|
import { ProjectFeatureToggles } from './ProjectFeatureToggles/ProjectFeatureToggles';
|
2021-10-01 12:15:02 +02:00
|
|
|
import ProjectInfo from './ProjectInfo/ProjectInfo';
|
|
|
|
import { useStyles } from './Project.styles';
|
|
|
|
|
|
|
|
interface ProjectOverviewProps {
|
|
|
|
projectId: string;
|
|
|
|
}
|
|
|
|
|
2021-10-08 15:18:43 +02:00
|
|
|
const ProjectOverview = ({ projectId }: ProjectOverviewProps) => {
|
2021-10-20 12:05:44 +02:00
|
|
|
const { project, loading } = useProject(projectId, {
|
|
|
|
refreshInterval: 10000,
|
|
|
|
});
|
2021-11-24 14:36:21 +01:00
|
|
|
const { members, features, health, description } = project;
|
2021-10-01 12:15:02 +02:00
|
|
|
const styles = useStyles();
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<div className={styles.containerStyles}>
|
|
|
|
<ProjectInfo
|
|
|
|
id={projectId}
|
2021-11-24 14:36:21 +01:00
|
|
|
description={description}
|
2021-10-01 12:15:02 +02:00
|
|
|
memberCount={members}
|
|
|
|
health={health}
|
|
|
|
featureCount={features?.length}
|
|
|
|
/>
|
2021-10-08 15:18:43 +02:00
|
|
|
<div className={styles.projectToggles}>
|
|
|
|
<ProjectFeatureToggles
|
|
|
|
features={features}
|
|
|
|
loading={loading}
|
|
|
|
/>
|
|
|
|
</div>
|
2021-10-01 12:15:02 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ProjectOverview;
|