failed timestamp text is in red color

This commit is contained in:
Hongbo Wu 2024-04-08 16:32:43 +08:00
parent f8a6887d09
commit 5dfbd7f238

View file

@ -230,17 +230,19 @@ export default function Rss(): JSX.Element {
>
<SpanBox>{`URL: ${subscription.url}`}</SpanBox>
{/* show failed timestamp instead of last refreshed timestamp if the feed failed to refresh */}
<SpanBox>{`${
subscription.failedAt
? `Failed to refresh: ${formattedDateTime(
subscription.failedAt
)}`
: `Last refreshed: ${
subscription.lastFetchedAt
? formattedDateTime(subscription.lastFetchedAt)
: 'Never'
}`
}`}</SpanBox>
{subscription.failedAt ? (
<SpanBox
css={{ color: 'red' }}
>{`Failed to refresh: ${formattedDateTime(
subscription.failedAt
)}`}</SpanBox>
) : (
<SpanBox>{`Last refreshed: ${
subscription.lastFetchedAt
? formattedDateTime(subscription.lastFetchedAt)
: 'Never'
}`}</SpanBox>
)}
<SpanBox>
{subscription.mostRecentItemDate &&
`Most recent item: ${formattedDateTime(