46 lines
1.1 KiB
JavaScript
Raw Normal View History

2018-08-07 15:09:55 +01:00
import PropTypes from "prop-types";
2018-08-02 13:52:10 -04:00
import React from 'react';
2018-08-03 12:29:33 -04:00
import {
Page,
Grid,
Card,
Table
} from "tabler-react";
2018-08-02 13:52:10 -04:00
import {Link} from 'react-router-dom';
const Contracts = ({contracts}) => (
2018-08-03 12:29:33 -04:00
<Page.Content title="Contracts">
<Grid.Row>
<Grid.Col>
<Card>
<Table
responsive
className="card-table table-vcenter text-nowrap"
headerItems={[
{content: "Name"},
{content: "Address"},
{content: "State"}
]}
bodyItems={
contracts.map((contract) => {
return ([
2018-08-15 14:59:16 +01:00
{content: <Link to={`/embark/contracts/${contract.className}/overview`}>{contract.className}</Link>},
2018-08-03 12:29:33 -04:00
{content: contract.address},
2018-08-07 15:09:55 +01:00
{content: contract.deploy.toString()}
2018-08-03 12:29:33 -04:00
]);
})
}
/>
</Card>
</Grid.Col>
</Grid.Row>
</Page.Content>
2018-08-02 13:52:10 -04:00
);
2018-08-07 15:09:55 +01:00
Contracts.propTypes = {
contracts: PropTypes.arrayOf(PropTypes.object)
};
2018-08-02 13:52:10 -04:00
export default Contracts;