перенес структуру Севы со своими правками

This commit is contained in:
ifraimka1 committed 2025-04-01 15:25:46 +03:00
1 parent 3a1cac0dfe
commit 808d97eb4b
331 files changed
+12260 -19950

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
import { usePostById } from "@/modules";
import { PagePost } from "@/widgets/PostPage";
import { useParams } from "react-router-dom";
function PostPage() {
const params = useParams();
const postId = params.id ? parseInt(params.id, 10) : null;
if (!postId) {
return <div>Не указан ID поста</div>;
}
const { data: post, isLoading, isError } = usePostById(postId);
if (isLoading) {
return (
<div className="mainContainer">
<span className="loader"></span>
</div>
);
}
if (isError) {
return <div>Ошибка при загрузке данных</div>;
}
console.log('post', post);
return <>{post && <PagePost post={post} isLab={false} />}</>;
}
export default PostPage;