| 123456789101112131415161718192021222324252627282930313233343536373839 |
- import React, { Component } from "react";
- import ContentWrapper from "@/components/Layout/ContentWrapper";
- import { Row, Col } from "reactstrap";
- import { getSanksi } from "@/actions/sanksi";
- import TableSanksi from "@/components/PT/Sanksi/TableSanksi";
- import { connect } from "react-redux";
- import Loader from "@/components/Common/Loader";
- class Sanksi extends Component {
- constructor(props) {
- super(props);
- this.state = {
- sanksi: {},
- };
- }
- componentDidMount = async () => {
- const { token } = this.props;
- const sanksi = await getSanksi(token);
- this.setState({ sanksi });
- };
- render() {
- const { sanksi } = this.state;
- return (
- <ContentWrapper>
- <div className="content-heading">
- <span className="font-color-white">
- Sanksi
- </span></div>
- <Row>
- <Col lg={12}>{sanksi.data?.length ? <TableSanksi listData={sanksi.data} to="/pt/sanksi/detail" toKeberatan="/pt/sanksi/keberatan/detail" toPerbaikan="/pt/dokumen-perbaikan/detail" toJwbKeberatan="/pt/sanksi/jawaban-keberatan/detail" toJwbBanding="/pt/sanksi/jawaban-banding/detail" toJwbBanding2="/pt/sanksi/jawaban-banding/detail" toCabutSanksi="/pt/sanksi/pencabutan-sanksi/detail" toJwbCabutSanksi="/pt/sanksi/jawaban-pencabutan-sanksi/detail" linkName="Detail" /> : sanksi.data ? "Tidak ada Sanksi" : <Loader />}</Col>
- </Row>
- </ContentWrapper>
- );
- }
- }
- const mapStateToProps = (state) => ({ user: state.user, token: state.token });
- export default connect(mapStateToProps)(Sanksi);
|