import { usePosts } from "@/modules/posts/hooks/usePosts"; import { PagePost } from "@/widgets/PostPage"; interface CategoryPageProps { category: string; } export function CategoryPage({ category }: CategoryPageProps) { const { data: postsData, isLoading, isError } = usePosts(); const categoryPosts = postsData?.other.filter((post) => post.categories.includes(category)) || []; if (isLoading) return (
); if (isError) return
Ошибка при загрузке данных
; return ( <> {categoryPosts.map((post) => (
Показать еще
))} ); }