/* eslint-disable max-statements */ import type { MDXComponents } from 'mdx/types'; import type { GetStaticProps } from 'next'; import Head from 'next/head'; import { useRouter } from 'next/router'; import Script from 'next/script'; import React, { type AnchorHTMLAttributes, type HTMLAttributes, type ReactNode, } from 'react'; import { useIntl } from 'react-intl'; import { getLayout, Heading, ImageWidget, Link, List, PageLayout, SocialMedia, ListItem, type MetaItemData, Time, } from '../components'; import CVContent, { data, meta } from '../content/pages/cv.mdx'; import styles from '../styles/pages/cv.module.scss'; import type { NextPageWithLayout } from '../types'; import { PERSONAL_LINKS, ROUTES } from '../utils/constants'; import { getSchemaJson, getSinglePageSchema, getWebPageSchema, } from '../utils/helpers'; import { loadTranslation } from '../utils/helpers/server'; import { useBreadcrumb, useSettings } from '../utils/hooks'; const ExternalLink = ({ children = '', href = '', ...props }: AnchorHTMLAttributes) => ( {children} ); const H1 = ({ children = '', ...props }: HTMLAttributes) => ( {children} ); const H2 = ({ children = '', ...props }: HTMLAttributes) => ( {children} ); const H3 = ({ children = '', ...props }: HTMLAttributes) => ( {children} ); const H4 = ({ children = '', ...props }: HTMLAttributes) => ( {children} ); const H5 = ({ children = '', ...props }: HTMLAttributes) => ( {children} ); const H6 = ({ children = '', ...props }: HTMLAttributes) => ( {children} ); const OrderedList = ({ children, ...props }: HTMLAttributes) => ( {children} ); const UnorderedList = ({ children, ...props }: HTMLAttributes) => ( {children} ); const components: MDXComponents = { a: ExternalLink, h1: H1, h2: H2, h3: H3, h4: H4, h5: H5, h6: H6, li: ({ ref, ...props }) => , Link, ol: OrderedList, ul: UnorderedList, }; /** * CV page. */ const CVPage: NextPageWithLayout = () => { const intl = useIntl(); const { file, image } = data; const { dates, intro, seo, title } = meta; const { items: breadcrumbItems, schema: breadcrumbSchema } = useBreadcrumb({ title, url: ROUTES.CV, }); const imageWidgetTitle = intl.formatMessage({ defaultMessage: 'Others formats', description: 'CVPage: cv preview widget title', id: 'B9OCyV', }); const socialMediaTitle = intl.formatMessage({ defaultMessage: 'Open-source projects', description: 'CVPage: social media widget title', id: '+Dre5J', }); const headerMeta: (MetaItemData | undefined)[] = [ { id: 'publication-date', label: intl.formatMessage({ defaultMessage: 'Published on:', description: 'Page: publication date label', id: '4QbTDq', }), value: