DetailLaporan.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import Scrollable from "@/components/Common/Scrollable";
  2. import moment from "moment";
  3. import { Col, FormGroup } from "reactstrap";
  4. function DetailLaporan({ data, noTitle = false }) {
  5. return (
  6. <>
  7. {noTitle ? "" : <p className="lead bb">Detail Laporan</p>}
  8. <form className="form-horizontal">
  9. <FormGroup row>
  10. <Col md="4">Nomor Laporan:</Col>
  11. <Col md="8">
  12. <strong>{data._number}</strong>
  13. </Col>
  14. </FormGroup>
  15. <FormGroup row>
  16. <Col md="4">Nama Perguruan Tinggi:</Col>
  17. <Col md="8">
  18. <strong>Universitas Satyagama</strong>
  19. </Col>
  20. </FormGroup>
  21. <FormGroup row>
  22. <Col md="4">Jenis Pelanggaran:</Col>
  23. <Col md="8">
  24. <Scrollable height="125px" className="list-group">
  25. <ul>
  26. {data.pelanggaran.map((e) => (
  27. <li>{e.pelanggaran}</li>
  28. ))}
  29. </ul>
  30. </Scrollable>
  31. </Col>
  32. </FormGroup>
  33. <FormGroup row>
  34. <Col md="4">Keterangan Laporan:</Col>
  35. <Col md="8">
  36. <Scrollable height="100px" className="list-group">
  37. <p>{data.description}</p>
  38. </Scrollable>
  39. </Col>
  40. </FormGroup>
  41. <FormGroup row>
  42. <Col md="4">Dibuat Pada:</Col>
  43. <Col md="8">
  44. <strong>{moment(data.createdAt).format("D MMMM YYYY")}</strong>
  45. </Col>
  46. </FormGroup>
  47. {data.status ? (
  48. <FormGroup row>
  49. <Col md="4">Status:</Col>
  50. <Col md="8">
  51. <div className="badge badge-info">{data.status}</div>
  52. </Col>
  53. </FormGroup>
  54. ) : (
  55. ""
  56. )}
  57. <FormGroup row>
  58. <Col md="4">File Pendukung:</Col>
  59. <Col md="8">
  60. <Scrollable height="120px" className="list-group">
  61. <table className="table table-bordered bg-transparent">
  62. <tbody>
  63. {data.files.map((e, index) => (
  64. <tr key={`files-${index}`}>
  65. <td>
  66. <em className="fa-lg far fa-file-code"></em>
  67. </td>
  68. <td>
  69. <a className="text-muted" href={`data:${e.type};base64, ${Buffer.from(e.data).toString("base64")}`} download={e.name}>
  70. {e.name}
  71. </a>
  72. </td>
  73. </tr>
  74. ))}
  75. </tbody>
  76. </table>
  77. </Scrollable>
  78. </Col>
  79. </FormGroup>
  80. </form>
  81. </>
  82. );
  83. }
  84. export default DetailLaporan;