mirror of
https://github.com/tjsga/tj-sga-website-react.git
synced 2025-04-21 20:09:51 -04:00
27 lines
679 B
TypeScript
27 lines
679 B
TypeScript
import imageUrl from '../lib/imageUrl';
|
|
import BlockContent from '@sanity/block-content-to-react';
|
|
import '../css/article.css';
|
|
|
|
export default function InitiativeRow({
|
|
initiative,
|
|
}: {
|
|
initiative: SGA.InitiativeDocument;
|
|
}) {
|
|
let thumbUrl: string | null = null;
|
|
if (initiative.thumbnail) {
|
|
thumbUrl = imageUrl(initiative.thumbnail).url();
|
|
}
|
|
|
|
return (
|
|
<div className='d-flex my-4'>
|
|
<div className='article-row-thumbnail'>
|
|
{thumbUrl ? <img src={thumbUrl} alt={initiative.name} /> : null}
|
|
</div>
|
|
<div className='article-row-content'>
|
|
<h3 className='header'>{initiative.name}</h3>
|
|
<BlockContent blocks={initiative.content} />
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|