2021-09-20 02:33:51 +02:00
|
|
|
import Image from 'next/image';
|
|
|
|
|
2021-02-04 06:42:15 +01:00
|
|
|
import { IFigureImage } from '../../../types/cms';
|
2021-09-20 05:24:57 +02:00
|
|
|
import { UI } from '../../../constants';
|
|
|
|
|
2021-06-29 10:35:37 +02:00
|
|
|
import { Contained } from '../../Contained';
|
|
|
|
import { ArticleContained } from '../../ArticleContained';
|
2021-01-22 03:43:42 +01:00
|
|
|
|
|
|
|
interface Props {
|
|
|
|
featureImage: IFigureImage;
|
2021-05-07 07:17:41 +02:00
|
|
|
title: string;
|
2021-01-22 03:43:42 +01:00
|
|
|
}
|
|
|
|
|
2021-05-07 07:17:41 +02:00
|
|
|
export function ArticleSectionFeatureImage({ featureImage, title }: Props) {
|
2021-01-22 03:43:42 +01:00
|
|
|
return (
|
2021-09-03 12:20:35 +02:00
|
|
|
<div className="w-full pb-4">
|
2021-09-20 02:33:51 +02:00
|
|
|
<div className="relative w-full h-full">
|
|
|
|
<Image
|
2021-09-20 05:24:57 +02:00
|
|
|
src={`${featureImage?.imageUrl}?w=${UI.MAX_CONTENT_WIDTH}`}
|
2021-05-07 07:17:41 +02:00
|
|
|
alt={featureImage?.description ?? title}
|
2021-09-20 02:33:51 +02:00
|
|
|
width={featureImage?.width}
|
|
|
|
height={featureImage?.height}
|
|
|
|
layout="responsive"
|
2021-09-20 05:24:57 +02:00
|
|
|
priority={true}
|
|
|
|
loading="eager"
|
2021-02-18 04:28:52 +01:00
|
|
|
/>
|
2021-01-22 03:43:42 +01:00
|
|
|
</div>
|
|
|
|
|
2021-02-02 06:28:00 +01:00
|
|
|
{featureImage?.description && (
|
2021-06-29 10:35:37 +02:00
|
|
|
<Contained>
|
|
|
|
<ArticleContained>
|
|
|
|
<div className="pt-2 italic ext-sm">
|
|
|
|
{featureImage?.description}
|
|
|
|
</div>
|
|
|
|
</ArticleContained>
|
|
|
|
</Contained>
|
2021-02-02 06:28:00 +01:00
|
|
|
)}
|
2021-01-22 03:43:42 +01:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|