TableRiwayat.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import Datatable from "@/components/Tables/Datatable";
  2. function TableRiwayat({ data }) {
  3. return (
  4. <Datatable options={{ responsive: true }}>
  5. <table className="table table-striped my-4 w-100">
  6. <thead>
  7. <tr>
  8. <th>Tanggal Dibuat</th>
  9. <th>Tanggal Dokumen</th>
  10. <th>Judul Dokumen</th>
  11. <th>File Pendukung</th>
  12. </tr>
  13. </thead>
  14. <tbody>
  15. {data.evaluasi.map((e, index) => (
  16. <tr key={index}>
  17. <td>{moment(e.createdAt).format("D MMMM YYYY")}</td>
  18. <td>{moment(e.tanggal).format("D MMMM YYYY")}</td>
  19. <td>{e.judul}</td>
  20. <td>
  21. {e.dokumen.map((e, index) => (
  22. <>
  23. <em key="index" className="fa-lg far fa-file-code"></em>
  24. <a className="text-muted" href={e.path} target="_blank" download={e.judul}>
  25. {e.judul}
  26. </a>
  27. <br />
  28. </>
  29. ))}
  30. </td>
  31. </tr>
  32. ))}
  33. </tbody>
  34. </table>
  35. </Datatable>
  36. );
  37. }
  38. export default TableRiwayat;