import { observer } from "mobx-react"; import * as React from "react"; import { Button, Menu, Segment} from "semantic-ui-react"; import { ProgramSequenceView, ScheduleView } from "@app/components"; import { AppState, injectState } from "@app/state"; import { Program, SprinklersDevice } from "@common/sprinklersRpc"; import { RouteComponentProps } from "react-router"; import { Link } from "react-router-dom"; @observer class ProgramDetailView extends React.Component { } @observer class ProgramPage extends React.Component<{ appState: AppState, } & RouteComponentProps<{ deviceId: string, programId: number }>> { device!: SprinklersDevice; render() { const { deviceId, programId } = this.props.match.params; const device = this.device = this.props.appState.sprinklersRpc.getDevice(deviceId); // TODO: check programId if (device.programs.length <= programId || !device.programs[programId]) { return null; } const program = device.programs[programId]; const programRows = this.renderRows(program, programId); return (