Riwayat.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import Datatable from "@/components/Tables/Datatable";
  2. import moment from "moment";
  3. import { Card, CardHeader, CardBody, CardTitle } from "reactstrap";
  4. function Riwayat({ data }) {
  5. return (
  6. <Card className="card-default">
  7. <CardHeader>
  8. <CardTitle>Riwayat</CardTitle>
  9. </CardHeader>
  10. <CardBody>
  11. <Datatable options={{ responsive: true }}>
  12. <table className="table table-striped my-4 w-100">
  13. <thead>
  14. <tr>
  15. <th>Tanggal</th>
  16. <th>Dokumen</th>
  17. </tr>
  18. </thead>
  19. <tbody>
  20. {data.length
  21. ? data.map((value) => (
  22. <tr>
  23. <td>{moment(value.createAt).format("DD MMMM YYYY")}</td>
  24. <td>
  25. {value.dokumen.map((e) => (
  26. <>
  27. <em className="fa-lg far fa-file-code"></em>
  28. <a className="text-muted" href={data.path} download={e.judul}>
  29. {e.judul}
  30. </a>
  31. </>
  32. ))}
  33. </td>
  34. </tr>
  35. ))
  36. : ""}
  37. </tbody>
  38. </table>
  39. </Datatable>
  40. </CardBody>
  41. </Card>
  42. );
  43. }
  44. export default Riwayat;