slate/scenes/SceneDataTransfer.js

69 lines
2.0 KiB
JavaScript
Raw Normal View History

2020-06-19 06:57:57 +03:00
import * as React from "react";
import * as Strings from "~/common/strings";
import * as Constants from "~/common/constants";
import * as Fixtures from "~/common/fixtures";
import * as System from "~/components/system";
import * as SchemaTable from "~/common/schema-table";
2020-06-19 06:57:57 +03:00
import { css } from "@emotion/react";
2020-06-19 06:57:57 +03:00
import ScenePage from "~/components/core/ScenePage";
import Section from "~/components/core/Section";
export default class SceneDataTransfer extends React.Component {
2020-06-19 06:57:57 +03:00
state = { sub_navigation: "1" };
_handleChange = (e) => {
this.setState({ [e.target.name]: e.target.value });
};
render() {
return (
<ScenePage>
<System.H1>Data transfers</System.H1>
<System.CardTabGroup
style={{ marginTop: 24 }}
name="sub_navigation"
options={[
2020-06-19 06:57:57 +03:00
{ value: "1", label: "Current transfers" },
{ value: "2", label: "Past transfers" },
]}
value={this.state.sub_navigation}
onChange={this._handleChange}
/>
2020-06-19 06:57:57 +03:00
{this.state.sub_navigation === "2" ? (
<Section
title="Past transfers"
onAction={this.props.onAction}
onNavigateTo={this.props.onNavigateTo}
>
<System.Table
data={{
columns: SchemaTable.DataTransfer,
rows: this.props.viewer.data_transfers,
}}
selectedRowId={this.state.table_past_transfer}
onChange={this._handleChange}
onNavigateTo={this.props.onNavigateTo}
onAction={this.props.onAction}
name="table_past_transfer"
/>
</Section>
) : null}
2020-06-19 06:57:57 +03:00
{this.state.sub_navigation === "1" ? (
<Section
onAction={this.props.onAction}
onNavigateTo={this.props.onNavigateTo}
title="Current transfers"
>
<System.P style={{ padding: 24 }}>There are no transfers</System.P>
</Section>
) : null}
</ScenePage>
);
}
}