import * as classNames from "classnames";
import { observer } from "mobx-react";
import * as React from "react";
import { Button, Icon, Segment } from "semantic-ui-react";
import { Duration } from "@common/Duration";
import { Section, SectionRun, SectionRunner } from "@common/sprinklers";
function PausedState({ paused }: { paused: boolean }) {
const classes = classNames({
"sectionRunner--pausedState": true,
"sectionRunner--pausedState-paused": paused,
"sectionRunner--pausedState-unpaused": !paused,
});
return (
{paused ? "Paused" : "Processing"}
);
}
function SectionRunView({ run, sections }:
{ run: SectionRun, sections: Section[] }) {
const section = sections[run.section];
const current = run.startTime != null;
const duration = Duration.fromSeconds(run.duration);
const cancel = run.cancel;
return (
'{section.name}' for {duration.toString()}
);
}
@observer
export default class SectionRunnerView extends React.Component<{
sectionRunner: SectionRunner, sections: Section[],
}, {}> {
render() {
const { current, queue, paused } = this.props.sectionRunner;
const { sections } = this.props;
const queueView = queue.map((run) =>
);
return (
Section Runner Queue
{current && }
{queueView}
);
}
}