import React, { Component } from "react"; import Select from "react-select"; import Scrollable from "@/components/Common/Scrollable"; import { addStatus } from "@/actions/pelaporan"; import { Card, CardBody, CardHeader, CardTitle } from "reactstrap"; const status = [ { value: "Ditindaklanjuti Dikti Ristek", label: "Ditindaklanjuti Dikti Ristek", className: "State-ACT" }, { value: "Delegasi ke LLDIKTI", label: "Delegasi ke LLDIKTI", className: "State-ACT" }, { value: "Ditutup", label: "Ditutup", className: "State-ACT" }, ]; const selectInstanceId = 1; export class DetailLaporan extends Component { constructor(props) { super(props); this.state = { selectedOption: null, }; } componentDidMount = () => { const { data } = this.props; if (data.status) { const selectedOption = status.filter((e) => e.value === data.status)[0]; this.setState({ selectedOption }); } else { this.setState({ selectedOption: { value: "Ditindaklanjuti", label: "Ditindaklanjuti Dikti Ristek", className: "State-ACT" } }); // const tes = await addStatus({ number, ptId }, { status: data.status || "ditindaklanjuti" }); } }; handleChangeSelect = async (selectedOption) => { const { ptId, number } = this.props.query; this.props.handleChangeSelect(selectedOption); this.setState({ selectedOption }); await addStatus({ number, ptId }, { status: selectedOption.value }); }; render() { const { data } = this.props; return ( Detail Laporan
Status
Nomor Laporan {data._number}
Perguruan Tinggi Universitas Satyagama
Jenis Pelanggaran
    {data.pelanggaran ? data.pelanggaran.map((e) =>
  • {e.pelanggaran}
  • ) : ""}
Keterangan Laporan

{data.description}

File Pendukung {data.files ? data.files.map((e) => ( )) : ""}
{e.name}
); } } export default DetailLaporan;