|  | @@ -1,4 +1,4 @@
 | 
	
		
			
				|  |  | -import React, { Component } from "react";
 | 
	
		
			
				|  |  | +import React, { Component, useState } from "react";
 | 
	
		
			
				|  |  |  import ContentWrapper from "@/components/Layout/ContentWrapper";
 | 
	
		
			
				|  |  |  import Header from "@/components/Main/Header";
 | 
	
		
			
				|  |  |  import DetailPT from "@/components/Main/DetailPT";
 | 
	
	
		
			
				|  | @@ -9,6 +9,10 @@ import { getOnePT } from "@/actions/PT";
 | 
	
		
			
				|  |  |  import Link from "next/link";
 | 
	
		
			
				|  |  |  import Loader from "@/components/Common/Loader";
 | 
	
		
			
				|  |  |  import { connect } from "react-redux";
 | 
	
		
			
				|  |  | +import { getPelaporan } from "../../../actions/pelaporan";
 | 
	
		
			
				|  |  | +import TableLaporan from "../../../components/Main/TableLaporan";
 | 
	
		
			
				|  |  | +import TableLaporan from "../../../components/Main/TablePemantauan";
 | 
	
		
			
				|  |  | +import { render } from "react-dom";
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  class Pemantauan extends Component {
 | 
	
		
			
				|  |  |  	constructor(props) {
 | 
	
	
		
			
				|  | @@ -16,23 +20,26 @@ class Pemantauan extends Component {
 | 
	
		
			
				|  |  |  		this.state = {
 | 
	
		
			
				|  |  |  			pt: {},
 | 
	
		
			
				|  |  |  			log: {},
 | 
	
		
			
				|  |  | +			tablept: {},
 | 
	
		
			
				|  |  |  		};
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  	static async getInitialProps({ query }) {
 | 
	
		
			
				|  |  |  		return { query };
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	componentDidMount = async () => {
 | 
	
		
			
				|  |  |  		const { query, token } = this.props;
 | 
	
		
			
				|  |  | -		const log = await getLog(token, query.ptId);
 | 
	
		
			
				|  |  | -		this.setState({ log });
 | 
	
		
			
				|  |  | +		const tablept = await getPelaporan(token, { pt_id: query.ptId });
 | 
	
		
			
				|  |  |  		const pt = await getOnePT(token, query.ptId);
 | 
	
		
			
				|  |  | -		this.setState({ pt });
 | 
	
		
			
				|  |  | +		this.setState({ pt, tablept });
 | 
	
		
			
				|  |  |  	};
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  	render() {
 | 
	
		
			
				|  |  | -		const { pt, log } = this.state;
 | 
	
		
			
				|  |  | +		const { pt, tablept } = this.state;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		return (
 | 
	
		
			
				|  |  |  			<ContentWrapper unwrap>
 | 
	
	
		
			
				|  | @@ -46,7 +53,7 @@ class Pemantauan extends Component {
 | 
	
		
			
				|  |  |  						</div>
 | 
	
		
			
				|  |  |  					</div>
 | 
	
		
			
				|  |  |  					<Row>
 | 
	
		
			
				|  |  | -						<Col xl="9">{log?.data ? <Timeline data={log.data} /> : <Loader />}</Col>
 | 
	
		
			
				|  |  | +						<Col xl="9">{tablept?.data ? <TablePemantauan listData={tablept.data} linkName="Detail" onclick={() => this.tablept.data()} /> : <Loader />}</Col>
 | 
	
		
			
				|  |  |  						<Col xl="3">{pt?.data ? <DetailPT data={pt.data} /> : <Loader />}</Col>
 | 
	
		
			
				|  |  |  					</Row>
 | 
	
		
			
				|  |  |  				</div>
 | 
	
	
		
			
				|  | @@ -54,6 +61,5 @@ class Pemantauan extends Component {
 | 
	
		
			
				|  |  |  		);
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  const mapStateToProps = (state) => ({ user: state.user, token: state.token });
 | 
	
		
			
				|  |  | -export default connect(mapStateToProps)(Pemantauan);
 | 
	
		
			
				|  |  | +export default connect(mapStateToProps)(Pemantauan);
 |