import React from "react";

import { Select } from "@material-ui/core";

const ManifestECUFileTypes = (props) => {
  const changeHandler = (e) => {
    if (!props.changeHandler) return;
    props.changeHandler(e);
  };

  return (
    <Select
      id={props.id}
      native
      variant="outlined"
      value={props.value}
      onChange={changeHandler}
    >
      {FileTypes.map((item, index) => (
        <option key={index} value={item[0]}>
          {item[1]}
        </option>
      ))}
    </Select>
  );
};

export default ManifestECUFileTypes;

const FileTypes = [
  ["bootloader", "Bootloader"],
  ["software", "Software"],
  ["calibration", "Calibration"],
  ["configuration", "Configuration"],
  ["none", "None"],
];
