Riwayat.js 1.1 KB

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