import React from "react";
import { Poi } from "../../redux/types/Poi";
import DemographicsSection from "../../sections/demographics";
import DescriptionSection from "../../sections/description";
import FootfallSection from "../../sections/footfall";
import ModeSection from "../../sections/mode";
import InformationSection from "../../sections/information";
import TraficSection from "../../sections/trafic";
type GraphSectionsProps = {
selectedPoi: Poi;
isDemographicsSection: boolean;
isFootfallSection: boolean;
isModeSection: boolean;
isInformationSection: boolean;
isTraficSection: boolean;
};
const GraphSections = ({
selectedPoi,
isDemographicsSection,
isFootfallSection,
isModeSection,
isInformationSection,
isTraficSection,
}: GraphSectionsProps) => {
const renderSection = (state: boolean, section: JSX.Element) => {
return state ? section : null;
};
return (
<>
{renderSection(
isDemographicsSection,
)}
{renderSection(
isFootfallSection,
)}
{renderSection(isModeSection, )}
{renderSection(
isInformationSection,
)}
{renderSection(
isTraficSection,
)}
>
);
};
export default GraphSections;