import * as React from "react"; import { observer } from "mobx-react"; import { SprinklersDevice, Section, Program } from "./sprinklers"; import { Item, Table, Header } from "semantic-ui-react"; import FontAwesome = require("react-fontawesome"); import * as classNames from "classnames"; import "semantic-ui-css/semantic.css"; import "font-awesome/css/font-awesome.css" import "app/style/app.css"; @observer class SectionRow extends React.PureComponent<{ section: Section }, void> { render() { const { name, state } = this.props.section; return ( Section {name} State: {state + ""} ); } } @observer class ProgramRow extends React.PureComponent<{ program: Program }, void> { render() { const { name, running } = this.props.program; return ( Program {name} running: {running + ""} ); } } @observer class DeviceView extends React.PureComponent<{ device: SprinklersDevice }, void> { render() { const { id, connected, sections, programs } = this.props.device; //src={require("app/images/raspberry_pi.png")} return (
Device {id}   {connected ? "Connected" : "Disconnected"}
Sections { sections.map((s, i) => ) }
Programs { programs.map((p, i) => ) }
); } } @observer export default class App extends React.PureComponent<{ device: SprinklersDevice }, any> { render() { return } }