import React from "react";
import { FormControl, InputLabel, Select } from "@material-ui/core";
import useStyles from "../../useStyles";

const ECUDropDown = (props) => {
  const changeHandler = (e) => {
    if (!props.changeHandler) return;
    props.changeHandler(e);
  };
  const classes = useStyles();

  return (
    <FormControl
      variant="outlined"
      margin="normal"
      fullWidth={false}
    >
      <InputLabel
        className={classes.whiteBackground}
        required={props.required}
        disabled={props.disabled}
      >
        {props.label}
      </InputLabel>
      <Select
        id={props.id}
        name={props.name}
        variant={"outlined"}
        native
        value={props.value}
        onChange={changeHandler}
        disabled={props.disabled}
      >
        {
          ECUs.map((item, index) => (
            <option key={index} value={item && item[0] ? item[0] : null}>
              {item && item[0] ? item[0] : null}
            </option>
          ))
        }
      </Select >
    </FormControl>
  );
};

export default ECUDropDown;

const ECUs = [
  null,
  ["AGS", "Active Grille Shutter"],
  ["ADB", "Adaptive Driving Beam"],
  ["ADAS", "Advanced Driver Assist System"],
  ["ACU", "Airbag Control Unit"],
  ["ACP", "Airconditioning Control Panel"],
  ["AMP", "Amplifier"],
  ["AP_FL", "Anti-Pinch Front Left"],
  ["AP_FR", "Anti-Pinch Front Right"],
  ["AP_RL", "Anti-Pinch Rear Left"],
  ["AP_RR", "Anti-Pinch Rear Right"],
  ["AL", "Atmosphere Lamp"],
  ["BCS", "Battery HV Current Sensor"],
  ["BMS", "Battery Management System"],
  ["BMU", "Battery Management Unit"],
  ["BCM", "Body Control Module"],
  ["CDS", "Center Display Screen"],
  ["CCU", "Charging Control Unit"],
  ["CIM", "Column Integrated Module"],
  ["CVM", "Coolant Valve Module"],
  ["CFM", "Cooling Fan Module"],
  ["CMRR_FL", "Corner Mid Range Radar Front Left"],
  ["CMRR_FR", "Corner Mid Range Radar Front Right"],
  ["CMRR_RL", "Corner Mid Range Radar Rear Left"],
  ["CMRR_RR", "Corner Mid Range Radar Rear Right"],
  ["DVRC", "Digital Video Recorder Camera"],
  ["DC-CHM", "Direct Current Charge Machine"],
  ["DMC", "Driver Monitor Camera"],
  ["DSMC", "Driver Seat Memory Controller"],
  ["DWSG", "Driver Window Switch Group"],
  ["EKS", "ElectroKnox"],
  ["EPS", "Electric Power Steering"],
  ["EAS", "Electrical Air Compressor System"],
  ["ECC", "Electrical Climate Controller"],
  ["EWP_B", "Electrical Water Pump Battery"],
  ["EWP_FD", "Electrical Water Pump Front Drive"],
  ["EWP_H", "Electrical Water Pump Heat"],
  ["EWP_RD", "Electrical Water Pump Rear Drive"],
  ["EWM", "Electrical Wiper Motor"],
  ["EXV_B", "Electronic Expansion Value Battery"],
  ["EXV_HP", "Electronic Expansion Valve HPC"],
  ["ESP", "Electronic Stability Program"],
  ["FDHA_FL", "Flush Door Handle Actuator Front Left"],
  ["FDHA_FR", "Flush Door Handle Actuator Front Right"],
  ["FDHA_RL", "Flush Door Handle Actuator Rear Left"],
  ["FDHA_RR", "Flush Door Handle Actuator Rear Right"],
  ["Lumber", "Four-Way Lumber"],
  ["FBM_L", "Front Beam Module Left"],
  ["FBM_R", "Front Beam Module Right"],
  ["FVC", "Front Video Camera"],
  ["GW", "Gateway"],
  ["HUD", "Head-Up Display"],
  ["IDS", "Instrument Display Screen"],
  ["ICC", "Integrated Cockpit Controller"],
  ["IBS", "Intelligent Battery Sensor"],
  ["iBooster", "Intelligent Booster"],
  ["KS", "Kick Sensor"],
  ["LSC", "Left Side Camera"],
  ["MRR", "Mid Range Radar"],
  ["MCU_F", "Motor Control Unit Front"],
  ["MCU_R", "Motor Control Unit Rear"],
  ["MDV", "Motorized Deco-Vent"],
  ["MFS", "Multifunction Steering"],
  ["MIS", "Multimedia Interactive Switch"],
  ["MPC", "Multipurpose Camera"],
  ["OMC", "Occupant Monitor Camera"],
  ["OHC", "Overhead Console"],
  ["PAS", "Parking Assistant System"],
  ["PCU", "Parking Control Unit"],
  ["PMS", "Particulate Matter Sensor"],
  ["PSM", "Passenger Seat Module"],
  ["PEPS", "Passive Entry And Passive Start"],
  ["PKC", "Phone Key Controller"],
  ["PKC_ANT_L", "Phone Key Controller Antenna Left"],
  ["PKC_ANT_R", "Phone Key Controller Antenna Right"],
  ["PWC", "Phone Wireless Charging"],
  ["PASC", "Power Adjust Steering Column"],
  ["PDU", "Power Distribution Unit"],
  ["PLGM", "Power Lift Gate Module"],
  ["RLS", "Rain Light Sensor"],
  ["RAC", "Rear Airconditioning Control"],
  ["RVC", "Rear View Camera"],
  ["RSC", "Right Side Camera"],
  ["RCM", "Roof Control Module"],
  ["RSM", "Roof Shade Module"],
  ["TBOX", "Telematics Box"],
  ["TPMS", "Tire Pressure Monitoring System"],
  ["TDS", "Touch Display Screen"],
  ["USB Box", "USB Box"],
  ["VCU", "Vehicle Control Unit"],
  ["VSP", "Vehicle Sound For Pedestraion"],
  ["WTC_B", "Water Thermal Controller Battery"],
  ["WTC_H", "Water Thermal Controller Heat"],
];
