import { usePostById } from "@/modules";
import { WpPost } from "@/widgets/WpPost";
import { useParams } from "react-router-dom";
import { ProjectsList } from "@/widgets/CardList/CardList";
import { SkeletonPost } from "@/shared/Components/SkeletonPost/SkeletonPost";
import { Helmet } from "react-helmet";
import { useEffect } from "react";
function WpPostPage() {
const params = useParams();
const postId = params.id ? parseInt(params.id, 10) : null;
const { data: post, isLoading, isError } = usePostById(postId || -1);
useEffect(() => {
if (post) {
window.scrollTo({ top: 0, behavior: "auto" });
}
}, [post]);
if (!postId) {
return (
<>