| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- import Datatable from "@/components/Tables/Datatable";
- import Swal from "sweetalert2";
- function TableRiwayat({ data, role }) {
- const handleOpenAlert = () => {
- Swal.fire({
- icon: 'error',
- title: 'Oops...',
- html: 'Maaf anda tidak memiliki akses untuk menyelesaikan<p> proses ini.</p>',
- confirmButtonColor: "#3e3a8e",
- confirmButtonText: 'Oke'
- })
- };
- return (
- // <Datatable options={{ responsive: true }}>
- <div className="card-over">
- <table className="table table-striped my-4 w-100">
- <thead>
- <tr>
- <th>Tanggal Dibuat</th>
- <th>Tanggal Dokumen</th>
- <th>Judul Dokumen</th>
- <th>File Pendukung</th>
- </tr>
- </thead>
- <tbody>
- {data.evaluasi.map((e, index) => (
- <tr key={index}>
- <td>{moment(e.createdAt).format("D MMMM YYYY")}</td>
- <td>{moment(e.tanggal).format("D MMMM YYYY")}</td>
- <td>{e.judul}</td>
- <td>
- {e.dokumen.map((e, index) => (
- <>
- <em key="index" className="fa-lg far fa-file-code"></em>
- {role === 2071 ?
- <a className="text-muted" onClick={handleOpenAlert} >
- {e.judul}
- </a>
- : <a className="text-muted" href={e.path} target="_blank" download={e.judul}>
- {e.judul}
- </a>
- }
- <a className="text-muted" href={e.path} target="_blank" download={e.judul}>
- {e.judul}
- </a>
- <br />
- </>
- ))}
- </td>
- </tr>
- ))}
- </tbody>
- </table>
- </div>
- // </Datatable>
- );
- }
- export default TableRiwayat;
|