index.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. console.log(sanksi)
  28. return (
  29. <ContentWrapper>
  30. <div className="content-heading">
  31. <span className="font-color-white">Perubahan Turun Sanksi</span>
  32. </div>
  33. <Row>
  34. {/* <Col lg="12">{graph?.data ? <CaseProgress data={graph.data} nextButton={this.nextButton} prevButton={this.prevButton} tahun={this.state.tahun} excel={this.excel} /> : <Loader />}</Col> */}
  35. <Col lg="12">{sanksi?.data ? <TableLaporan status noBy listData={sanksi.data} to="/app/turun-sanksi/detail" linkName="Detail" /> : <Loader />}</Col>
  36. </Row>
  37. </ContentWrapper>
  38. );
  39. }
  40. }
  41. const mapStateToProps = (state) => ({ user: state.user, token: state.token });
  42. export default connect(mapStateToProps)(NaikSanksi);