import React from 'react'; import { useSelector } from 'react-redux'; import { isEmpty } from 'lodash'; import { selectNewsSingle, selectSingleLoadingStatus } from '../store/news.selectors'; import { Spinner } from 'app/shared/components/spinner/spinner'; import * as Text from 'app/shared/components/text/text'; export const NewsSingle = () => { const news = useSelector(selectNewsSingle); const isLoading = useSelector(selectSingleLoadingStatus); if (isEmpty(news)) { return null; } const panelImageStyle = news?.leadingImage ? { backgroundImage: `url(${news.leadingImage})` } : {}; return ( <> {isLoading ? :
{news && <>
{news.publishDate}
{news.title}
{news.summary}
}
} ); };