File size: 1,162 Bytes
beea437
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
39
40
41
42
import React from "react";
import PropTypes from "prop-types";
import { FormControl, InputLabel, MenuItem, Select } from "@mui/material";

export const LABELS = {
  map: "Map View",
  bourdieu: "Bourdieu View",
  docs: "Data"
};

function DropdownMenu({ onSelectView, selectedView }) {
  const handleSelectView = (event) => {
    if (onSelectView) onSelectView(`${event.target.value}`);
  };

  return (
    <FormControl variant="outlined" className="dropdown-menu" sx={{ minWidth: "200px", marginTop: "1em" }}>
      <InputLabel htmlFor="view-select">Select a View</InputLabel>
      <Select
        label="Select a View"
        value={selectedView}
        onChange={handleSelectView}
        inputProps={{
          name: "view-select",
          id: "view-select",
        }}
      >
        <MenuItem value="map">{LABELS.map}</MenuItem>
        {/* <MenuItem value="bourdieu">{LABELS.bourdieu}</MenuItem> */}
        <MenuItem value="docs">{LABELS.docs}</MenuItem>
      </Select>
    </FormControl>
  );
}

DropdownMenu.propTypes = {
  onSelectView: PropTypes.func.isRequired,
  selectedView: PropTypes.string.isRequired,
};

export default DropdownMenu;