import * as classNames from "classnames"; import {observer} from "mobx-react"; import * as React from "react"; import {Table} from "semantic-ui-react"; import {Section} from "../sprinklers"; import FontAwesome = require("react-fontawesome"); /* tslint:disable:object-literal-sort-keys */ @observer export default class SectionTable extends React.PureComponent<{ sections: Section[] }, {}> { private static renderRow(section: Section, index: number) { if (!section) { return null; } const {name, state} = section; return ( {"" + (index + 1)} {name} {state ? ( Irrigating) : "Not irrigating"} ); } render() { return ( Sections # Name State { this.props.sections.map(SectionTable.renderRow) }
); } }