|  | @@ -16,6 +16,7 @@ class Sanksi extends Component {
 | 
	
		
			
				|  |  |  		this.state = {
 | 
	
		
			
				|  |  |  			pelaporan: {},
 | 
	
		
			
				|  |  |  			graph: {},
 | 
	
		
			
				|  |  | +			tahun: new Date().getFullYear(),
 | 
	
		
			
				|  |  |  		};
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -26,6 +27,22 @@ class Sanksi extends Component {
 | 
	
		
			
				|  |  |  		this.setState({ pelaporan, graph });
 | 
	
		
			
				|  |  |  	};
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +	nextButton = async () => {
 | 
	
		
			
				|  |  | +		const tahun = this.state.tahun + 1;
 | 
	
		
			
				|  |  | +		const graph = await getGraph(this.props.token, { sanksi: true, tahun });
 | 
	
		
			
				|  |  | +		this.setState({ graph, tahun });
 | 
	
		
			
				|  |  | +	};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	prevButton = async () => {
 | 
	
		
			
				|  |  | +		const tahun = this.state.tahun - 1;
 | 
	
		
			
				|  |  | +		const graph = await getGraph(this.props.token, { sanksi: true, tahun });
 | 
	
		
			
				|  |  | +		this.setState({ graph, tahun });
 | 
	
		
			
				|  |  | +	};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	shouldComponentUpdate = (prevProps, prevState) => {
 | 
	
		
			
				|  |  | +		if (prevState.graph !== this.state.graph) return true;
 | 
	
		
			
				|  |  | +	};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  	render() {
 | 
	
		
			
				|  |  |  		const { pelaporan, graph } = this.state;
 | 
	
		
			
				|  |  |  		return (
 | 
	
	
		
			
				|  | @@ -41,7 +58,7 @@ class Sanksi extends Component {
 | 
	
		
			
				|  |  |  					</div>
 | 
	
		
			
				|  |  |  				</div>
 | 
	
		
			
				|  |  |  				<Row>
 | 
	
		
			
				|  |  | -					<Col lg="4">{graph?.data ? <CaseProgress data={graph.data} /> : <Loader />}</Col>
 | 
	
		
			
				|  |  | +					<Col lg="4">{graph?.data ? <CaseProgress data={graph.data} nextButton={this.nextButton} prevButton={this.prevButton} tahun={this.state.tahun} /> : <Loader />}</Col>
 | 
	
		
			
				|  |  |  					<Col lg="8">{pelaporan.data ? <TableLaporan listData={pelaporan.data} /> : <Loader />}</Col>
 | 
	
		
			
				|  |  |  				</Row>
 | 
	
		
			
				|  |  |  			</ContentWrapper>
 |