import React, { Component } from "react";
import ContentWrapper from "@/components/Layout/ContentWrapper";
import { Row, Col } from "reactstrap";
import CaseProgress from "@/components/Main/CaseProgress";
import TableSanksi from "@/components/Main/TableSanksi";
import { getSanksi } from "@/actions/sanksi";

class PemantauanPerbaikan extends Component {
	constructor(props) {
		super(props);
		this.state = {
			sanksi: {},
		};
	}

	componentDidMount = async () => {
		const sanksi = await getSanksi({ docPerbaikan: true });
		this.setState({ sanksi });
	};

	render() {
		const { sanksi } = this.state;
		return (
			<ContentWrapper>
				<div className="content-heading">Pemantauan Perbaikan</div>
				<Row>
					<Col lg="4">
						<CaseProgress />
					</Col>
					<Col lg="8">
						<TableSanksi listData={sanksi.data} to="/app/pemantauan-perbaikan/detail" linkName="Detail" />
					</Col>
				</Row>
			</ContentWrapper>
		);
	}
}

export default PemantauanPerbaikan;
