import * as React from "react";
import * as Strings from "~/common/strings";
import * as Constants from "~/common/constants";
import * as System from "~/components/system";
import { css } from "@emotion/react";
import Section from "~/components/core/Section";
import ScenePage from "~/components/core/ScenePage";
const STYLES_NESTED_TABLE = css`
display: grid;
grid-template-columns: 160px 1fr;
`;
let iterator = 0;
const NestedTable = (data) => {
let values = [];
for (let entries of Object.entries(data)) {
if (entries[0] !== "rootCid") {
iterator += 1;
values.push(
{entries[0]}
);
values.push({entries[1]}
);
}
}
return {values}
;
};
export default class SceneDeals extends React.Component {
state = {};
async componentDidMount() {
await this.props.onRehydrate();
}
_handleChange = (e) => {
this.setState({ [e.target.name]: e.target.value });
};
render() {
console.log(this.props);
return (
Deals
{
return {
id: each.rootCid,
address: each.addr,
rootCid: each.rootCid,
status: each.pending ? "2" : "1",
time: each.time,
children: NestedTable(each.dealInfo),
};
}),
}}
selectedRowId={this.state.selectedRowId}
onClick={this._handleClick}
/>
{
return {
id: each.dealInfo.rootCid,
address: each.addr,
rootCid: each.dealInfo.rootCid,
time: each.time,
children: NestedTable(each.dealInfo),
};
}),
}}
selectedRowId={this.state.selectedRowId}
onClick={this._handleClick}
name={this.props.name}
/>
);
}
}