import React, { Component } from "react";
import { editModeIconStyle, editModeStyle } from "./styleComponents";

export default class Settings extends Component {
  constructor(props) {
    super(props);
    this.state = {
      displayForm: true,
    };
  }

  displayForm = () => {
    this.setState((prevState) => ({ displayForm: !prevState.displayForm }));
  };

  render() {
    const view = (
      <div onClick={() => this.props.edit.openModal(this.props.deviceId)}>
        <span style={editModeStyle}>
          <img src="/img/settings.svg" alt="" style={editModeIconStyle} />
        </span>
      </div>
    );
    return <React.Fragment>{this.props.edit.mode ? view : ""}</React.Fragment>;
  }
}
