File size: 1,263 Bytes
0c20ea8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { useState, useEffect } from "react";
import { Poi } from "../../redux/types/Poi";
import { convertModeObjectToArray } from "../../utils/convertModeObjectToArray";
import { FaWalking } from "react-icons/fa";
import { AiFillCar } from "react-icons/ai";

type DemographicsSectionProps = {
  selectedPoi: Poi;
};
const ModeSection: React.FC<DemographicsSectionProps> = ({ selectedPoi }) => {
  return (
    //isSelected ?
    <div className="modeSection">
      <div className="sectionModeDivider">
        <div className="weekDistributionTitle">People walking</div>
        <div className="averageModeWrapper">
          {selectedPoi
            ? convertModeObjectToArray(selectedPoi?.data.mode)[0]
            : "20%"}
          <FaWalking style={{ marginLeft: "2%", fontSize: "50px" }} />
        </div>
      </div>
      <div className="sectionModeDivider">
        <div className="weekDistributionTitle">People using vehicles</div>
        <div className="averageModeWrapper">
          {selectedPoi
            ? convertModeObjectToArray(selectedPoi?.data.mode)[1]
            : "20%"}
          <AiFillCar style={{ marginLeft: "2%", fontSize: "50px" }} />
        </div>
      </div>
    </div>
    //) : ( <></>
  );
};

export default ModeSection;