index.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import React, { Component } from "react";
  2. import ContentWrapper from "@/components/Layout/ContentWrapper";
  3. import { Row, Col } from "reactstrap";
  4. import { getSanksi } from "@/actions/sanksi";
  5. import TableSanksi from "@/components/PT/JawabanBanding/TableSanksiJawaban";
  6. import { connect } from "react-redux";
  7. import Loader from "@/components/Common/Loader";
  8. class JawabanKeberatan extends Component {
  9. constructor(props) {
  10. super(props);
  11. this.state = {
  12. sanksi: {},
  13. };
  14. }
  15. componentDidMount = async () => {
  16. const { token } = this.props;
  17. const sanksi = await getSanksi(token, { banding: true });
  18. this.setState({ sanksi });
  19. };
  20. render() {
  21. const { sanksi } = this.state;
  22. return (
  23. <ContentWrapper>
  24. <div className="content-heading">Jawaban Atas Permohonan Banding</div>
  25. <Row>
  26. <Col lg={12}>{sanksi.data?.length ? <TableSanksi listData={sanksi.data} to="/pt/jawaban-banding/detail" linkName="Detail" /> : sanksi.data ? "" : <Loader />}</Col>
  27. </Row>
  28. </ContentWrapper>
  29. );
  30. }
  31. }
  32. const mapStateToProps = (state) => ({ user: state.user, token: state.token });
  33. export default connect(mapStateToProps)(JawabanKeberatan);