import { Document, Page, StyleSheet, View } from "@react-pdf/renderer";
import Header from "./components/header";
import Footer from "./components/footer";

interface Props {
  content: JSX.Element;
}

export default function AgPDFTemplate(props: Props) {
  const pdfStyle = StyleSheet.create({
    page: {
      fontSize: 11,
      padding: "5%"
    },
    header: {
      flexDirection: "row",
      height: "8%"
    },
    content: {
      flexDirection: "row",
      height: "87%"
    },
    footer: {
      flexDirection: "row",
      height: "5%"
    }
  });
  return (
    <Document>
      <Page size={"A4"} style={pdfStyle.page}>
        <View style={pdfStyle.header}>
          <Header />
        </View>
        <View style={pdfStyle.content}>{props.content}</View>
        <View style={pdfStyle.footer}>
          <Footer />
        </View>
      </Page>
    </Document>
  );
}
