import { library } from "@fortawesome/fontawesome-svg-core"; import { fab } from "@fortawesome/free-brands-svg-icons"; import { far } from "@fortawesome/free-regular-svg-icons"; import { fas } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import Image from "next/image"; import Config from "../../config.json"; library.add(fab, far, fas); // Loading in the icons from FontAwesome export default function Home() { const { background, infoCard, avatar, name, links, socialLinks, options, description, theme, } = Config; // All of the settings pulled from the config file // Theme colors to use when using the selected theme // all used colors are from TailwindCSS const themeColors: { [key: string]: { background: string; textColor: string; buttonTextColor: string; }; } = { dark: { background: "bg-neutral-900", textColor: "text-white", buttonTextColor: "text-white", }, light: { background: "bg-white", textColor: "text-black", buttonTextColor: "text-white", }, }; const selectedTheme = themeColors[theme] || themeColors.dark; // The theme to use (fallback of dark) return ( <>
Avatar

{name}

{/* Description of user */}

{description}

{/* Links (Buttons) */}
{links && links.map((link, index) => { const icons: any = link.icon?.split(" ") ?? []; return ( {link.icon && }

{link.title}

); })}
{/* Social Links */}
{socialLinks && socialLinks.map((link, index) => { const icons: any = link.icon?.split(" ") ?? []; return ( {link.icon && ( )} ); })}
{/* Footer */}
{options.showSourceLink && ( Website Source )}
); }