index.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import React, { Component } from "react";
  2. import ContentWrapper from "@/components/Layout/ContentWrapper";
  3. import { Row, Col } from "reactstrap";
  4. import { getPelaporan } from "@/actions/pelaporan";
  5. import { getSanksi } from "@/actions/sanksi";
  6. import TableLaporan from "@/components/TurunSanksi/TableLaporan";
  7. import { connect } from "react-redux";
  8. import Loader from "@/components/Common/Loader";
  9. class NaikSanksi extends Component {
  10. constructor(props) {
  11. super(props);
  12. this.state = {
  13. pelaporan: {},
  14. graph: {},
  15. tahun: new Date().getFullYear(),
  16. sanksi: {}
  17. };
  18. }
  19. componentDidMount = async () => {
  20. const { token } = this.props;
  21. const pelaporan = await getPelaporan(token, { sanksi: true });
  22. const sanksi = await getSanksi(token, { turunSanksi: true, sanksi: true })
  23. this.setState({ pelaporan, sanksi });
  24. };
  25. render() {
  26. const { pelaporan, sanksi } = this.state;
  27. return (
  28. <ContentWrapper>
  29. <div className="content-heading">
  30. <span className="font-color-white">Perubahan Turun Sanksi</span>
  31. </div>
  32. <Row>
  33. {/* <Col lg="12">{graph?.data ? <CaseProgress data={graph.data} nextButton={this.nextButton} prevButton={this.prevButton} tahun={this.state.tahun} excel={this.excel} /> : <Loader />}</Col> */}
  34. <Col lg="12">{sanksi?.data ? <TableLaporan status noBy listData={sanksi.data} to="/app/turun-sanksi/detail" linkName="Detail" /> : <Loader />}</Col>
  35. </Row>
  36. </ContentWrapper>
  37. );
  38. }
  39. }
  40. const mapStateToProps = (state) => ({ user: state.user, token: state.token });
  41. export default connect(mapStateToProps)(NaikSanksi);