import type { UserReport } from "@fitai/shared";
import PDFGenerator from "./pdf-generator";

/**
 * Generate a PDF report from a UserReport object
 */
export function generateReportPDF(report: UserReport): Blob {
  const generator = new PDFGenerator();
  generator.generateUserReport(report);
  return generator.toBlob();
}

/**
 * Generate a PDF report and return as base64 string
 */
export function generateReportPDFBase64(report: UserReport): string {
  const generator = new PDFGenerator();
  generator.generateUserReport(report);
  return generator.toBase64();
}

/**
 * Generate a PDF report and save to file
 */
export function saveReportPDF(report: UserReport, filename: string): void {
  const generator = new PDFGenerator();
  generator.generateUserReport(report);
  generator.save(filename);
}

export default {
  generateReportPDF,
  generateReportPDFBase64,
  saveReportPDF,
};
