PermohonanPT.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import Scrollable from "@/components/Common/Scrollable";
  2. import { Col, FormGroup } from "reactstrap";
  3. import Swal from "sweetalert2";
  4. function PermohonanPT({ data, title = null, role }) {
  5. const handleOpenAlert = () => {
  6. Swal.fire({
  7. icon: 'error',
  8. title: 'Oops...',
  9. html: 'Maaf anda tidak memiliki akses untuk menyelesaikan<p> proses ini.</p>',
  10. confirmButtonColor: "#3e3a8e",
  11. confirmButtonText: 'Oke'
  12. })
  13. };
  14. return (
  15. <>
  16. <p className="lead bb">{title || "Permohonan dari PT"}</p>
  17. <form className="form-horizontal">
  18. <FormGroup row>
  19. <Col md="4">Dokumen Permohonan:</Col>
  20. <Col md="8">
  21. <Scrollable height="120px" className="list-group">
  22. <table className="table table-bordered bg-transparent">
  23. <tbody>
  24. {data.dokumen.map((e) => (
  25. <tr>
  26. <td style={{ width: "30px" }}>
  27. <em className="fa-lg far fa-file-code"></em>
  28. </td>
  29. <td>
  30. {role === 2071 ?
  31. <a className="text-muted" onClick={handleOpenAlert}>
  32. {e.judul}
  33. </a>
  34. :
  35. <a className="text-muted" href={e.path} target="_blank" download={e.judul}>
  36. {e.judul}
  37. </a>
  38. }
  39. </td>
  40. </tr>
  41. ))}
  42. </tbody>
  43. </table>
  44. </Scrollable>
  45. </Col>
  46. </FormGroup>
  47. </form>
  48. </>
  49. );
  50. }
  51. export default PermohonanPT;