import React, { Component } from "react";
import { Card, CardBody, TabContent, TabPane, Nav, NavItem, NavLink, Button, Row, Col } from "reactstrap";
import Router from "next/router";
import classnames from "classnames";
import ContentWrapper from "@/components/Layout/ContentWrapper";
import DetailSanksi from "@/components/Main/DetailSanksi";
import Header from "@/components/Main/Header";
import Link from "next/link";
import { getPelaporan } from "@/actions/pelaporan";
import { createSanksi } from "@/actions/sanksi";

const stepNavitemStyle = {
	backgroundColor: "#fcfcfc",
};

class Detail extends Component {
	constructor(props) {
		super(props);
	}

	static getInitialProps = async ({ query }) => {
		const pelaporan = await getPelaporan({ ptId: query.ptId, number: query.number });
		return { query, pelaporan };
	};

	render() {
		const { pelaporan } = this.props;
		return (
			<ContentWrapper unwrap>
				{/* <Header /> */}
				<div className="p-3">
					<div className="content-heading">
						<div>Detail Sanksi</div>
						<div className="ml-auto">
							<Link href="/app/sanksi">
								<button className="btn btn-sm btn-secondary text-sm">&lt; back</button>
							</Link>
						</div>
					</div>
					<Card className="card-default">
						<CardBody>
							<Row>
								<Col>
									<DetailSanksi data={pelaporan.data[0]} />
								</Col>
							</Row>
						</CardBody>
					</Card>
				</div>
			</ContentWrapper>
		);
	}
}

export default Detail;
