import Heading from '@components/atoms/headings/heading';
import Link from '@components/atoms/links/link';
import List from '@components/atoms/lists/list';
import ImageWidget from '@components/organisms/widgets/image-widget';
import SocialMedia from '@components/organisms/widgets/social-media';
import { getLayout } from '@components/templates/layout/layout';
import PageLayout, {
  type PageLayoutProps,
} from '@components/templates/page/page-layout';
import CVContent, { data, meta } from '@content/pages/cv.mdx';
import styles from '@styles/pages/cv.module.scss';
import { type NextPageWithLayout } from '@ts/types/app';
import { loadTranslation } from '@utils/helpers/i18n';
import {
  getSchemaJson,
  getSinglePageSchema,
  getWebPageSchema,
} from '@utils/helpers/schema-org';
import useBreadcrumb from '@utils/hooks/use-breadcrumb';
import useSettings from '@utils/hooks/use-settings';
import { NestedMDXComponents } from 'mdx/types';
import { GetStaticProps } from 'next';
import Head from 'next/head';
import { useRouter } from 'next/router';
import Script from 'next/script';
import React, { ReactNode } from 'react';
import { useIntl } from 'react-intl';
/**
 * 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: `/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: PageLayoutProps['headerMeta'] = {
    publication: {
      date: dates.publication,
    },
    update: dates.update
      ? {
          date: dates.update,
        }
      : undefined,
  };
  const { website } = useSettings();
  const cvAlt = intl.formatMessage(
    {
      defaultMessage: '{name} CV',
      description: 'CVPage: CV image alternative text',
      id: 'KUowUk',
    },
    { name: website.name }
  );
  const cvCaption = intl.formatMessage(
    {
      defaultMessage: 'Download the CV in PDF',
      id: 'fN04AJ',
      description: 'CVPage: download CV in PDF text',
    },
    {
      link: (chunks: ReactNode) => (
        
          {chunks}
        
      ),
    }
  );
  const widgets = [
    ,
    ,
  ];
  const { asPath } = useRouter();
  const webpageSchema = getWebPageSchema({
    description: seo.description,
    locale: website.locales.default,
    slug: asPath,
    title: seo.title,
    updateDate: dates.update,
  });
  const cvSchema = getSinglePageSchema({
    cover: image.src,
    dates,
    description: intro,
    id: 'cv',
    kind: 'about',
    locale: website.locales.default,
    slug: asPath,
    title: title,
  });
  const schemaJsonLd = getSchemaJson([webpageSchema, cvSchema]);
  const components: NestedMDXComponents = {
    a: (props) => ,
    h1: (props) => ,
    h2: (props) => ,
    h3: (props) => ,
    h4: (props) => ,
    h5: (props) => ,
    h6: (props) => ,
    Link: (props) => ,
    List: (props) => 
,
  };
  return (
    
      
        {`${seo.title} - ${website.name}`}
        
        
        
        
        
        
        
      
      
      
    
  );
};
CVPage.getLayout = (page) =>
  getLayout(page, { useGrid: true, withExtraPadding: true });
export const getStaticProps: GetStaticProps = async ({ locale }) => {
  const translation = await loadTranslation(locale);
  return {
    props: {
      translation,
    },
  };
};
export default CVPage;