index.js 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. import React, { Component } from "react";
  2. import Router from "next/router";
  3. import ContentWrapper from "@/components/Layout/ContentWrapper";
  4. import { Row, Col, Progress, Button } from "reactstrap";
  5. import { getPelaporan } from "../../../../actions/pelaporan";
  6. import Sparkline from "@/components/Common/Sparklines";
  7. import Datatable from "@/components/Tables/Datatable";
  8. import moment from "moment";
  9. class Pelaporan extends Component {
  10. constructor(props) {
  11. super(props);
  12. }
  13. // static getInitialProps = async () => {
  14. // const pelaporan = await getPelaporan();
  15. // return { pelaporan };
  16. // };
  17. detailLaporanClick = (e, ptId, number) => {
  18. e.preventDefault();
  19. Router.push({
  20. pathname: "/app/pt/dokumen-perbaikan/detail",
  21. // query: { ptId, number },
  22. });
  23. };
  24. render() {
  25. // const { pelaporan } = this.props;
  26. return (
  27. <ContentWrapper>
  28. <div className="content-heading">Dokumen Perbaikan</div>
  29. <Row>
  30. <Col lg={12}>
  31. <div className="card b">
  32. <div className="card-body">
  33. <Datatable options={{ responsive: true }}>
  34. <table className="table w-100">
  35. <thead>
  36. <tr>
  37. <th>#ID</th>
  38. <th>Description</th>
  39. <th>Created</th>
  40. <th>Status</th>
  41. <th></th>
  42. </tr>
  43. </thead>
  44. <tbody>
  45. {/* {pelaporan.data.map((value) => {
  46. return ( */}
  47. <tr key={1}>
  48. <td>BI:987654</td>
  49. <td className="text-nowrap">
  50. <div className="media align-items-center">
  51. <img className="img-fluid rounded thumb64" src="/static/img/dummy-search.png" alt="Dummy" />
  52. <div className="media-body d-flex">
  53. <div>
  54. <h4 className="m-0">Universitas Satyagama</h4>
  55. <small className="text-muted">0742/O/1990 - www.satyagama.ac.id - info@satyagama.ac.id</small>
  56. <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Blanditiis, reiciendis.</p>
  57. </div>
  58. </div>
  59. </div>
  60. </td>
  61. <td>{moment().fromNow()}</td>
  62. <td>
  63. <div className="inline wd-xxs badge badge-success">open</div>
  64. </td>
  65. <td>
  66. <Button color="primary" onClick={(e) => this.detailLaporanClick(e)}>Detail</Button>
  67. </td>
  68. </tr>
  69. {/* );
  70. })} */}
  71. </tbody>
  72. </table>
  73. </Datatable>
  74. </div>
  75. </div>
  76. </Col>
  77. </Row>
  78. </ContentWrapper>
  79. );
  80. }
  81. }
  82. export default Pelaporan;