mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 18:52:56 +00:00
hot fix #1
This commit is contained in:
@@ -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>
|
||||
)}
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user