From 7d8a725e342c463cfaa196d8370525dff204922e Mon Sep 17 00:00:00 2001 From: smanylov Date: Mon, 25 May 2026 14:53:09 +0700 Subject: [PATCH] cange location layout for history view table --- .../tracking-page/tracking-history-view.tsx | 31 ++++++++++++------- src/i18n/messages/en.json | 7 +++-- src/i18n/messages/ru.json | 7 +++-- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/app/ui/tracking-page/tracking-history-view.tsx b/src/app/ui/tracking-page/tracking-history-view.tsx index 432e014..94e1cfc 100644 --- a/src/app/ui/tracking-page/tracking-history-view.tsx +++ b/src/app/ui/tracking-page/tracking-history-view.tsx @@ -84,15 +84,23 @@ export function TrackingHistoryView() { return nameWithoutExtension.substring(0, maxNameLength) + '...'; } - const editLocationName = (location: string | undefined | null) => { - if (!location) return ''; + function EditLocationName({ location }: { location: string | undefined | null }) { + if (!location) return ( +
+ ); const [city, country] = location.split('/'); const translatedCity = city === 'unknow' ? t('not-defined-city') : city; const translatedCountry = country === 'unknow' ? t('not-defined-country') : country; - return `${translatedCity}/${translatedCountry}`; + return ( +
+ {t('city')}: {translatedCity} +
+ {t('country')}: {translatedCountry} +
+ ); } const columns = useMemo[]>( @@ -213,7 +221,7 @@ export function TrackingHistoryView() { { accessorKey: 'location', header: ({ column }) => ( -
+
{t('location')} @@ -243,7 +251,7 @@ export function TrackingHistoryView() { {row.original.country === 'unknow/unknow' ? ( t('not-defined') ) : ( - `${editLocationName(row.original.country)}` + )}
) @@ -252,7 +260,7 @@ export function TrackingHistoryView() { ], [] ); - + /* `${editLocationName(row.original.country)}` */ // Создание таблицы const table = useReactTable({ data: tableData, @@ -287,13 +295,14 @@ export function TrackingHistoryView() { className="block-wrapper" >
-

- {t('history-of-opened')} -

+ {/* Фильтры */}
+

+ {t('history-of-opened')} +

{t('items-per-page')}:
diff --git a/src/i18n/messages/en.json b/src/i18n/messages/en.json index dd7cc1c..74fae72 100644 --- a/src/i18n/messages/en.json +++ b/src/i18n/messages/en.json @@ -473,12 +473,13 @@ "location": "Location", "history-of-opened": "History of opened", "not-defined": "Not defined", - "not-defined-city": "The city is not defined", - "not-defined-country": "Country not defined", + "not-defined-city": "Not defined", + "not-defined-country": "Not defined", "total-document-openings": "Total document openings", "total-matches": "Total matches", "total-complaints": "Total complaints", - "total-claims": "Total claims" + "total-claims": "Total claims", + "city": "City" }, "Login-register-form": { "and": "and", diff --git a/src/i18n/messages/ru.json b/src/i18n/messages/ru.json index 229d078..71a534c 100644 --- a/src/i18n/messages/ru.json +++ b/src/i18n/messages/ru.json @@ -473,12 +473,13 @@ "location": "Местоположение", "history-of-opened": "История открытий", "not-defined": "Не определено", - "not-defined-city": "Город не определен", - "not-defined-country": "Страна не определена", + "not-defined-city": "Не определен", + "not-defined-country": "Не определена", "total-document-openings": "Всего открытий документов", "total-matches": "Всего совпадений", "total-complaints": "Всего нарушений", - "total-claims": "Всего претензий" + "total-claims": "Всего претензий", + "city": "Город" }, "Login-register-form": { "and": "и",