index.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import React, { Component } from "react";
  2. import ContentWrapper from "@/components/Layout/ContentWrapper";
  3. import { Row, Col } from "reactstrap";
  4. import CaseProgress from "@/components/Main/CaseProgress";
  5. import TableSanksi from "@/components/PencabutanSanksi/TableSanksi";
  6. import { getSanksi } from "@/actions/sanksi";
  7. import { connect } from "react-redux";
  8. import Loader from "@/components/Common/Loader";
  9. class PencabutanSanksi extends Component {
  10. constructor(props) {
  11. super(props);
  12. this.state = {
  13. sanksi: {},
  14. };
  15. }
  16. componentDidMount = async () => {
  17. const { token } = this.props;
  18. const sanksi = await getSanksi(token, { cabutSanksi: true, jawaban: true });
  19. this.setState({ sanksi });
  20. };
  21. render() {
  22. const { sanksi } = this.state;
  23. return (
  24. <ContentWrapper>
  25. <div className="content-heading">
  26. <span className="font-color-white">Permohonan Pencabutan Sanksi</span>
  27. </div>
  28. <Row>
  29. {/* <Col lg="4">
  30. <CaseProgress />
  31. </Col> */}
  32. <Col lg="12">{sanksi.data ? <TableSanksi listData={sanksi.data} to="/app/pencabutan-sanksi/detail" linkName="Detail" /> : <Loader />}</Col>
  33. </Row>
  34. </ContentWrapper>
  35. );
  36. }
  37. }
  38. const mapStateToProps = (state) => ({ user: state.user, token: state.token });
  39. export default connect(mapStateToProps)(PencabutanSanksi);