index.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. this.state = {
  12. user: {},
  13. };
  14. }
  15. static getInitialProps = async () => {
  16. const pelaporan = await getPelaporan();
  17. return { pelaporan };
  18. };
  19. render() {
  20. const { pelaporan } = this.props;
  21. console.log(this.state.user);
  22. return (
  23. <ContentWrapper>
  24. <div className="content-heading">Pelaporan</div>
  25. <Row>
  26. <Col lg="4">
  27. <CaseProgress />
  28. </Col>
  29. <Col lg="8">
  30. <div className="mb-3 d-flex">
  31. <div>
  32. <Link href="/app/pelaporan/search">
  33. <Button color="primary">Laporan Baru</Button>
  34. </Link>
  35. </div>
  36. </div>
  37. <TableLaporan listData={pelaporan.data} to="/app/pelaporan/detail" linkName="Detail" />
  38. </Col>
  39. </Row>
  40. </ContentWrapper>
  41. );
  42. }
  43. }
  44. export default Pelaporan;