import { Document, Page } from "@react-pdf/renderer";

import { EstateSummarySection } from "@/pdf/components/estate-summary";
import { HeirBreakdownTable } from "@/pdf/components/heir-breakdown-table";
import { InheritancePieChartSection } from "@/pdf/components/inheritance-pie-chart";
import { QuranReferencesSection } from "@/pdf/components/quran-references";
import { ReportDisclaimerSection } from "@/pdf/components/report-disclaimer";
import { ReportHeader } from "@/pdf/components/report-header";
import { reportStyles } from "@/pdf/styles/report-styles";
import type { InheritancePdfReportData } from "@/pdf/types";

interface InheritanceReportDocumentProps {
  data: InheritancePdfReportData;
}

export function InheritanceReportDocument({
  data,
}: InheritanceReportDocumentProps) {
  return (
    <Document title={data.reportTitle}>
      <Page size="A4" style={reportStyles.page}>
        <ReportHeader
          reportTitle={data.reportTitle}
          reportId={data.reportId}
          generatedAt={data.generatedAt}
        />
        <EstateSummarySection estate={data.estate} />
        <HeirBreakdownTable heirs={data.heirs} currency={data.estate.currency} />
        <InheritancePieChartSection heirs={data.heirs} />
        <QuranReferencesSection references={data.quranReferences} />
        <ReportDisclaimerSection disclaimer={data.disclaimer} />
      </Page>
    </Document>
  );
}
