import { useArticleViewModel } from "article/controller/articleViewModel";
import { useArticleStore } from "article/data/articleStoreImplementation";
import { useEffect } from "react";
import * as ArticlePart from "../../components/Article/Article";
import { useParams } from "react-router";
import AskeletonArticle from "./AskeletonArticle";
import Container from "components/Container";
import NotFound from "./NotFound";
import { SVGSearch } from "components/icons";
import BaseLayout from "components/BaseLayout";
import Typography from "components/typography/Typography";
import { useTranslation } from "react-i18next";
const AnArticle = () => {
const store = useArticleStore();
const { article, hasError, shouldShowLoading } = useArticleViewModel(store);
const { i18n, t } = useTranslation();
const { id } = useParams();
const newId = `${id}`;
useEffect(() => {
store.getArticle(newId);
}, [id]);
if (hasError) {
return ;
}
return (
{shouldShowLoading ? (
) : (
<>
{article?.topic}
{article?.title}
{article?.authors !== undefined ? article?.authors : "Unknown"}
{article?.tags && (
{t("articlePage.keywords")}
{article?.tags}
)}
{t("articlePage.abstract")}
{article?.summary !== undefined ? (
article?.summary
) : (
)}
>
)}
);
};
// \n
export default AnArticle;