feat: implement PDF viewer for resume previews and integrate with report panel

This commit is contained in:
Anish Sarkar 2026-04-15 21:42:50 +05:30
parent 07bd076317
commit 06c344d66e
5 changed files with 174 additions and 2 deletions

View file

@ -24,18 +24,30 @@ interface ExportMenuItemsProps {
exporting: string | null;
/** Hide server-side formats (PDF, DOCX, etc.) — only show md */
showAllFormats?: boolean;
/** When true, only show PDF export (used for Typst-based resumes) */
pdfOnly?: boolean;
}
export function ExportDropdownItems({
onExport,
exporting,
showAllFormats = true,
pdfOnly = false,
}: ExportMenuItemsProps) {
const handle = (format: string) => (e: React.MouseEvent) => {
e.stopPropagation();
onExport(format);
};
if (pdfOnly) {
return (
<DropdownMenuItem onClick={handle("pdf")} disabled={exporting !== null}>
{exporting === "pdf" && <Loader2 className="mr-2 h-3.5 w-3.5 animate-spin" />}
PDF (.pdf)
</DropdownMenuItem>
);
}
return (
<>
{showAllFormats && (