diff --git a/apps/web/app/components/PdfExportView.tsx b/apps/web/app/components/PdfExportView.tsx index c0bcd13..4559022 100644 --- a/apps/web/app/components/PdfExportView.tsx +++ b/apps/web/app/components/PdfExportView.tsx @@ -38,6 +38,8 @@ export default function PdfExportView({ const [copiedMd, setCopiedMd] = useState(false); const sectionMeta = getSectionMeta(summary.section); + const categoriesList = summary.categories || []; + const authorsList = summary.authors || []; // Available categories for filtering const allCategories = useMemo(() => { @@ -101,76 +103,26 @@ export default function PdfExportView({ URL.revokeObjectURL(url); } - function getCategoryBadgeClass(category: string): string { - const cat = category.toLowerCase(); - if (cat.includes("web")) { - return "bg-sky-500/10 text-sky-600 dark:text-sky-400 border-sky-500/30"; - } - if (cat.includes("crypto")) { - return "bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/30"; - } - if (cat.includes("pwn") || cat.includes("binary")) { - return "bg-rose-500/10 text-rose-600 dark:text-rose-400 border-rose-500/30"; - } - if (cat.includes("reverse") || cat.includes("rev")) { - return "bg-purple-500/10 text-purple-600 dark:text-purple-400 border-purple-500/30"; - } - if (cat.includes("forensic") || cat.includes("dfir")) { - return "bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/30"; - } - if (cat.includes("osint")) { - return "bg-teal-500/10 text-teal-600 dark:text-teal-400 border-teal-500/30"; - } - return "bg-[var(--brand)]/10 text-[var(--brand)] dark:text-[var(--accent)] border-[var(--brand)]/30"; - } - - function getCategoryIcon(category: string): string { - const cat = category.toLowerCase(); - if (cat.includes("web")) return "๐"; - if (cat.includes("crypto")) return "๐"; - if (cat.includes("pwn") || cat.includes("binary")) return "โก"; - if (cat.includes("reverse") || cat.includes("rev")) return "โ๏ธ"; - if (cat.includes("forensic") || cat.includes("dfir")) return "๐"; - if (cat.includes("osint")) return "๐ฐ๏ธ"; - if (cat.includes("mobile")) return "๐ฑ"; - if (cat.includes("hardware")) return "๐"; - return "๐ฉ"; - } - - function getDifficultyBadgeClass(difficulty: string): string { - const diff = difficulty.toLowerCase(); - if (/easy|simple|beginner/i.test(diff)) { - return "bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/30"; - } - if (/medium|intermediate/i.test(diff)) { - return "bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/30"; - } - if (/hard|expert|advanced|insane/i.test(diff)) { - return "bg-rose-500/10 text-rose-600 dark:text-rose-400 border-rose-500/30"; - } - return "bg-[var(--bg-elevated)] text-[var(--text-muted)] border-[var(--border-color)]"; - } - return (