| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- import React, { Component } from "react";
- import ContentWrapper from "@/components/Layout/ContentWrapper";
- import { Row, Col } from "reactstrap";
- import CaseProgress from "@/components/Main/CaseProgress";
- import TableSanksi from "@/components/Banding/TableSanksi";
- import { getSanksi } from "@/actions/sanksi";
- import Loader from "@/components/Common/Loader";
- import { connect } from "react-redux";
- class Banding extends Component {
- constructor(props) {
- super(props);
- this.state = {
- sanksi: {},
- };
- }
- componentDidMount = async () => {
- const { token } = this.props;
- const sanksi = await getSanksi(token, { banding: true });
- this.setState({ sanksi });
- };
- render() {
- const { sanksi } = this.state;
- return (
- <ContentWrapper>
- <div className="content-heading">Banding</div>
- <Row>
- <Col lg="4">
- <CaseProgress />
- </Col>
- <Col lg="8">{sanksi.data ? <TableSanksi listData={sanksi.data} to="/app/banding/detail" linkName="Detail" /> : <Loader />}</Col>
- </Row>
- </ContentWrapper>
- );
- }
- }
- const mapStateToProps = (state) => ({ user: state.user, token: state.token });
- export default connect(mapStateToProps)(Banding);
|