import React from 'react'; import { Link, useParams } from 'react-router-dom'; import Hero from '../components/Hero'; import useQuery from '../hooks/useInitiatives'; import imageUrl from '../imageUrl'; import BlockContent from '@sanity/block-content-to-react'; export default function NewsArticle() { let { articleId } = useParams<{ articleId: string }>(); let article = useQuery('*[_id == $articleId] [0]', { articleId, }); if (!article) { return null; } let thumbUrl: string | undefined = undefined; if (article.thumbnail) { thumbUrl = imageUrl(article.thumbnail).url() || undefined; } return ( <>
{article.publish_date} - {article.author || 'No author'}
Go to all news articles

); }