import { t } from "@lingui/core/macro"; import { ArticleIcon, BooksIcon, BriefcaseIcon, CertificateIcon, ChartLineIcon, CodeSimpleIcon, CompassToolIcon, DiamondsFourIcon, DownloadIcon, FileCssIcon, FootballIcon, GraduationCapIcon, HandHeartIcon, type IconProps, ImageIcon, InfoIcon, LayoutIcon, MessengerLogoIcon, NotepadIcon, PaletteIcon, PhoneIcon, ReadCvLogoIcon, ShareFatIcon, StarIcon, TextTIcon, TranslateIcon, TrophyIcon, UserIcon, } from "@phosphor-icons/react"; import { match } from "ts-pattern"; import type { SectionType } from "@/schema/resume/data"; import { cn } from "../style"; export type LeftSidebarSection = "picture" | "basics" | "summary" | SectionType | "custom"; export type RightSidebarSection = | "template" | "layout" | "typography" | "design" | "page" | "css" | "notes" | "sharing" | "statistics" | "export" | "information"; export type SidebarSection = LeftSidebarSection | RightSidebarSection; export const leftSidebarSections: LeftSidebarSection[] = [ "picture", "basics", "summary", "profiles", "experience", "education", "projects", "skills", "languages", "interests", "awards", "certifications", "publications", "volunteer", "references", "custom", ] as const; export const rightSidebarSections: RightSidebarSection[] = [ "template", "layout", "typography", "design", "page", "css", "notes", "sharing", "statistics", "export", "information", ] as const; export const getSectionTitle = (type: SidebarSection): string => { return ( match(type) // Left Sidebar Sections .with("picture", () => t`Picture`) .with("basics", () => t`Basics`) .with("summary", () => t`Summary`) .with("profiles", () => t`Profiles`) .with("experience", () => t`Experience`) .with("education", () => t`Education`) .with("projects", () => t`Projects`) .with("skills", () => t`Skills`) .with("languages", () => t`Languages`) .with("interests", () => t`Interests`) .with("awards", () => t`Awards`) .with("certifications", () => t`Certifications`) .with("publications", () => t`Publications`) .with("volunteer", () => t`Volunteer`) .with("references", () => t`References`) .with("custom", () => t`Custom Sections`) // Right Sidebar Sections .with("template", () => t`Template`) .with("layout", () => t`Layout`) .with("typography", () => t`Typography`) .with("design", () => t`Design`) .with("page", () => t`Page`) .with("css", () => t`Custom CSS`) .with("notes", () => t`Notes`) .with("sharing", () => t`Sharing`) .with("statistics", () => t`Statistics`) .with("export", () => t`Export`) .with("information", () => t`Information`) .exhaustive() ); }; export const getSectionIcon = (type: SidebarSection, props?: IconProps): React.ReactNode => { const iconProps = { ...props, className: cn("shrink-0", props?.className) }; return ( match(type) // Left Sidebar Sections .with("picture", () => ) .with("basics", () => ) .with("summary", () => ) .with("profiles", () => ) .with("experience", () => ) .with("education", () => ) .with("projects", () => ) .with("skills", () => ) .with("languages", () => ) .with("interests", () => ) .with("awards", () => ) .with("certifications", () => ) .with("publications", () => ) .with("volunteer", () => ) .with("references", () => ) .with("custom", () => ) // Right Sidebar Sections .with("template", () => ) .with("layout", () => ) .with("typography", () => ) .with("design", () => ) .with("page", () => ) .with("css", () => ) .with("notes", () => ) .with("sharing", () => ) .with("statistics", () => ) .with("export", () => ) .with("information", () => ) .exhaustive() ); };