This commit is contained in:
Tomas Dvorak
2026-01-26 08:13:18 +01:00
parent aa036b6550
commit dfc079288f
505 changed files with 95755 additions and 5712 deletions
+10 -3
View File
@@ -1,5 +1,6 @@
import React from 'react';
import { assetUrl } from '../../utils/url';
import { useTranslation } from 'react-i18next';
export type NewsListItem = {
id: number | string;
@@ -14,7 +15,13 @@ const NewsList: React.FC<{
emptyText?: string;
seeAllHref?: string;
seeAllLabel?: string;
}> = ({ items, emptyText = 'Zatím nejsou k dispozici žádné aktuality.', seeAllHref, seeAllLabel = 'Zobrazit všechny aktuality' }) => {
}> = ({ items, emptyText, seeAllHref, seeAllLabel }) => {
const { t } = useTranslation();
// Use provided text or fallback to translations
const emptyTextFinal = emptyText || t('news.no_news');
const seeAllLabelFinal = seeAllLabel || t('news.view_all_news');
return (
<>
<div className="blog-list">
@@ -32,13 +39,13 @@ const NewsList: React.FC<{
))
) : (
<div style={{ padding: '24px', textAlign: 'center', color: 'var(--dark-gray)', background: 'var(--bg-soft)', borderRadius: '12px' }}>
<p>{emptyText}</p>
<p>{emptyTextFinal}</p>
</div>
)}
</div>
{seeAllHref && items && items.length > 0 && (
<div style={{ marginTop: 12 }}>
<a className="btn" href={seeAllHref}>{seeAllLabel}</a>
<a className="btn" href={seeAllHref}>{seeAllLabelFinal}</a>
</div>
)}
</>