mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 04:59:45 +00:00
перенес структуру Севы со своими правками
This commit is contained in:
1 parent
3a1cac0dfe
commit
808d97eb4b
331 files changed
+12260
-19950
No files matched your search
@@ -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;
|
||||
Reference in new issue
Block a user