aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Widgets/CVPreview/CVPreview.tsx
blob: cf6a8fa5dfc6d2acc2390b2a72dfe53f3cdbfac9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { ExpandableWidget } from '@components/WidgetParts';
import Image from 'next/image';
import Link from 'next/link';
import { FormattedMessage } from 'react-intl';
import styles from './CVPreview.module.scss';

const CVPreview = ({
  title,
  imgSrc,
  pdf,
}: {
  title: string;
  imgSrc: string;
  pdf: string;
}) => {
  return (
    <ExpandableWidget title={title} expand={true}>
      <div className={styles.preview}>
        <Image
          src={imgSrc}
          layout="fill"
          objectFit="contain"
          objectPosition="left"
          alt="CV Armand Philippot"
        />
      </div>
      <p>
        <FormattedMessage
          defaultMessage="Download <link>CV in PDF</link>"
          description="CVPreview: download as PDF link"
          id="xC3Khf"
          values={{
            link: (chunks: string) => (
              <Link href={pdf}>
                <a>{chunks}</a>
              </Link>
            ),
          }}
        />
      </p>
    </ExpandableWidget>
  );
};

export default CVPreview;