import { useMemo } from 'react'; import Markdown from '@/components/shared/Markdown'; import { useAppSelector } from '@/store/hooks'; import { PageProps } from '@/utils/template'; import { getSectionById } from '../sectionMap'; import styles from './Onyx.module.scss'; import Masthead from './widgets/Masthead'; import Section from './widgets/Section'; const Onyx: React.FC = ({ page }) => { const isFirstPage = useMemo(() => page === 0, [page]); const { summary } = useAppSelector((state) => state.resume.basics); const layout: string[][] = useAppSelector((state) => state.resume.metadata.layout[page]); return (
{isFirstPage && (
{summary}
)}
{layout[0].map((key) => getSectionById(key, Section))}
{layout[1].map((key) => getSectionById(key, Section))}
); }; export default Onyx;