index.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import React, { Component } from "react";
  2. import ContentWrapper from "@/components/Layout/ContentWrapper";
  3. import Link from "next/link";
  4. import { Row, Col, Button } from "reactstrap";
  5. import { getPelaporan } from "@/actions/pelaporan";
  6. import CaseProgress from "@/components/Main/CaseProgress";
  7. import TableLaporan from "@/components/Main/TableLaporan";
  8. class Pelaporan extends Component {
  9. constructor(props) {
  10. super(props);
  11. }
  12. static getInitialProps = async () => {
  13. const pelaporan = await getPelaporan();
  14. return { pelaporan };
  15. };
  16. render() {
  17. const { pelaporan } = this.props;
  18. return (
  19. <ContentWrapper>
  20. <div className="content-heading">Pelaporan</div>
  21. <Row>
  22. <Col lg="4">
  23. <CaseProgress />
  24. </Col>
  25. <Col lg="8">
  26. <div className="mb-3 d-flex">
  27. <div>
  28. <Link href="/app/pelaporan/search">
  29. <Button color="primary">Laporan Baru</Button>
  30. </Link>
  31. </div>
  32. </div>
  33. <TableLaporan listData={pelaporan.data} to="/app/pelaporan/detail" linkName="Detail" />
  34. </Col>
  35. </Row>
  36. </ContentWrapper>
  37. );
  38. }
  39. }
  40. export default Pelaporan;