| 12345678910111213141516171819202122232425262728293031323334353637 |
- import React, { useRef, Component } from 'react';
- import { useReactToPrint } from "react-to-print";
- import { Row, Col, Button } from "reactstrap";
- import Head from 'next/head'
- import SignatureCanvas from 'react-signature-canvas'
- import ComponentToPrint from "./SuratBA";
- import ReactToPrint, { PrintContextConsumer } from 'react-to-print';
- class BeritaAcara extends Component {
- render() {
- // console.log(this.props.laporan)
- return (
- <div>
- <ReactToPrint pageStyle='print' content={() => this.componentRef}>
- <PrintContextConsumer>
- {({ handlePrint }) => (
- <div className=' content-heading border-radius-login'>
- <span className="btn-radius">
- <Button onClick={handlePrint} color className="btn-labeled-4">
- <h4 className="p-0 mt-2">Print dan Download</h4>
- </Button>
- </span>
- </div>
- )}
- </PrintContextConsumer>
- </ReactToPrint>
- {/* <div style={{ display: "none" }}> */}
- <ComponentToPrint laporan={this.props.laporan} ref={el => (this.componentRef = el)} />
- {/* </div> */}
- </div >
- );
- }
- }
- export default BeritaAcara
|