oxen-website/components/article/sections/ArticleSectionFeatureImage.tsx

33 lines
863 B
TypeScript
Raw Normal View History

2021-02-04 06:42:15 +01:00
import { IFigureImage } from '../../../types/cms';
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;
title: string;
2021-01-22 03:43:42 +01:00
}
export function ArticleSectionFeatureImage({ featureImage, title }: Props) {
2021-01-22 03:43:42 +01:00
return (
<div className="w-full pb-4">
2021-06-29 10:42:45 +02:00
<div className="relative flex items-center justify-center w-full h-full">
2021-02-18 04:28:52 +01:00
<img
src={featureImage?.imageUrl}
alt={featureImage?.description ?? title}
2021-06-29 09:50:18 +02:00
className="object-fill"
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>
);
}