import Scrollable from "@/components/Common/Scrollable"; import moment from "moment"; import { Col, FormGroup, Table, Button } from "reactstrap"; import { API_URL } from "@/env"; import React, { Component } from "react"; import { getOneSanksi } from "../../actions/sanksi"; import ReactToPrint, { PrintContextConsumer } from 'react-to-print'; import ComponentBA from "../Sanksi/SuratBA _detail"; import Link from "next/dist/client/link"; import { connect } from "react-redux"; import Swal from "sweetalert2"; class DetailSanksi extends Component { constructor(props) { super(props); this.state = { sanksi: {}, }; } static getInitialProps = async ({ query }) => { return { query }; }; componentDidMount = async () => { const { query, token } = this.props; const sanksi = await getOneSanksi(token, query.id); this.setState({ sanksi }); }; handleOpenAlert = () => { Swal.fire({ icon: 'error', title: 'Oops...', html: 'Maaf anda tidak memiliki akses untuk menyelesaikan
proses ini.
', confirmButtonColor: "#3e3a8e", confirmButtonText: 'Oke' }) }; render() { const { sanksi } = this.state return ( <>Detail Sanksi
{sanksi.data && } > ) } } const mapStateToProps = (state) => ({ user: state.user, token: state.token }); export default connect(mapStateToProps)(DetailSanksi)