import React, { useState, Fragment } from "react"; import moment from "moment"; import "moment/locale/id"; import Swal from "sweetalert2"; import { Table } from "reactstrap"; moment.locale("id"); function TableRiwayat({ data = [], data_pelanggaran = {}, role }) { const [openIndex, setOpenIndex] = useState(null); const toggleRow = (index) => { setOpenIndex(openIndex === index ? null : index); }; const handleOpenAlert = () => { Swal.fire({ icon: "error", title: "Oops...", html: "Maaf anda tidak memiliki akses untuk menyelesaikan
proses ini.
", confirmButtonColor: "#3e3a8e", confirmButtonText: "Oke", }); }; return (| Tanggal | Keterangan | Nomor Surat Sanksi | Dokumen Surat Sanksi | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Data tidak tersedia | ||||||||||
| {item.createdAt ? moment(item.createdAt).format("DD/MM/YYYY") : "-"} | {item.keterangan || "-"} | {item.no_sanksi || "-"} |
{item.dokumen?.length > 0 ? (
item.dokumen.map((doc, i) => (
{role === 2071 ? (
{doc.judul}
) : (
{doc.judul}
)}
))
) : (
"-"
)}
|
toggleRow(index)} > {openIndex === index ? : } | ||||||
|
||||||||||