Files
ToBePlayed-Frontend/src/components/NewsEntry.jsx
T
lobo 8598024bce feat(hint): targets, automatic hints and formatting
Target fields on the admin hints page. The dashboard shows the four
automatic hints after admin hints when their condition is true, using
data Core already serves. HintText renders **bold** and safe links (app
path or https) as React elements, never HTML, in hints and news.
Auto-close without tick hides for this session, X for 7 days, tick + X
for good.
2026-10-02 14:36:49 +02:00

19 lines
745 B
React

import {useTranslation} from 'react-i18next';
import {cn} from '@/lib/utils';
import HintText from './HintText.jsx';
import {formatDate} from '../utils/format.js';
import {newsText, newsTitle} from '../utils/news.js';
export default function NewsEntry({entry, className}) {
const {i18n} = useTranslation();
return (
<article className={cn('space-y-1', className)}>
<p className="text-xs text-muted-foreground">{formatDate(entry.publishedAt, i18n.language, {dateStyle: 'medium'})}</p>
<h3 className="font-semibold">{newsTitle(entry, i18n.language)}</h3>
<p className="whitespace-pre-line break-words text-sm"><HintText text={newsText(entry, i18n.language)}/></p>
</article>
);
}