import React from "react";
import Light from "./Light";
import SmartPlug from "./SmartPlug";
import Sensor from "./Sensor";
import DefaultDimmer from "./Dimmer";
import Switcher from "./Switch";

const DeviceType = (props) => {
  switch (props.type) {
    case "regularLight":
      return (
        <Light
          updateDev={props.updateDeviceUi}
          onChangeData={props.changeDeviceData}
          device={props.device}
          edit={props.edit}
        />
      );
    case "sensor":
      return (
        <Sensor
          updateDev={props.updateDeviceUi}
          onChangeData={props.changeDeviceData}
          device={props.device}
          edit={props.edit}
        />
      );
    case "motionSensor":
      return (
        <Sensor
          updateDev={props.updateDeviceUi}
          onChangeData={props.changeDeviceData}
          device={props.device}
          edit={props.edit}
        />
      );
    case "buttonDimmer":
      return (
        <DefaultDimmer
          updateDev={props.updateDeviceUi}
          onChangeData={props.changeDeviceData}
          device={props.device}
          edit={props.edit}
        />
      );
    case "smartPlug":
      return (
        <SmartPlug
          updateDev={props.updateDeviceUi}
          onChangeData={props.changeDeviceData}
          device={props.device}
          edit={props.edit}
        />
      );
    case "switch":
      return (
        <Switcher
          updateDev={props.updateDeviceUi}
          onChangeData={props.changeDeviceData}
          device={props.device}
          edit={props.edit}
        />
      );
    case "dimmableLight":
      return (
        <Light
          updateDev={props.updateDeviceUi}
          onChangeData={props.changeDeviceData}
          device={props.device}
          edit={props.edit}
        />
      );
    default:
      return "";
  }
};

export default DeviceType;
