feat: Add translation on 3 languages for sight page
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { articlesStore, authStore, Language } from "@shared";
|
||||
import { articlesStore } from "@shared";
|
||||
import { observer } from "mobx-react-lite";
|
||||
import { useEffect, useState } from "react";
|
||||
import {
|
||||
@@ -73,7 +73,10 @@ export const SelectArticleModal = observer(
|
||||
setIsLoading(true);
|
||||
|
||||
try {
|
||||
await Promise.all([getArticle(articleId), getArticleMedia(articleId)]);
|
||||
await Promise.all([
|
||||
getArticle(Number(articleId)),
|
||||
getArticleMedia(Number(articleId)),
|
||||
]);
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch article data:", error);
|
||||
// Reset article data on error
|
||||
@@ -83,9 +86,11 @@ export const SelectArticleModal = observer(
|
||||
setIsLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
// @ts-ignore
|
||||
const filteredArticles = articles
|
||||
// @ts-ignore
|
||||
.filter((article) => !linkedArticleIds.includes(article.id))
|
||||
// @ts-ignore
|
||||
.filter((article) =>
|
||||
article.service_name.toLowerCase().includes(searchQuery.toLowerCase())
|
||||
);
|
||||
@@ -140,6 +145,7 @@ export const SelectArticleModal = observer(
|
||||
{searchQuery ? "Статьи не найдены" : "Нет доступных статей"}
|
||||
</Typography>
|
||||
) : (
|
||||
// @ts-ignore
|
||||
filteredArticles.map((article) => (
|
||||
<ListItemButton
|
||||
key={article.id}
|
||||
|
||||
Reference in New Issue
Block a user