'use client'; import React from 'react'; import Link from 'next/link'; import { Breadcrumb } from '@/components/Common/Breadcrumb'; import Skeleton from '@/components/Common/Skeleton'; import { ArticleTopLeft } from '../ArticleTopLeft'; import { ArticleTopRight } from '../ArticleTopRight'; import { BoxVideoArticle } from './BoxVideoArticle'; import { BoxArticleMid } from './BoxArticleMid'; import { BoxArticleReview } from './BoxArticleReview'; import { getArticleCategories } from '@/lib/api/article'; import { useApiData } from '@/hooks/useApiData'; import type { TypeArticleCategory } from '@/types/article/ListCategoryArticle'; const ArticleHomeSkeleton = () => (
{Array.from({ length: 5 }).map((_, i) => ( ))}
{Array.from({ length: 4 }).map((_, i) => ( ))}
{Array.from({ length: 6 }).map((_, i) => ( ))}
); const ArticleHome = () => { const breadcrumbItems = [{ name: 'Tin tức', url: '/tin-tuc' }]; const { data: categories, isLoading } = useApiData( () => getArticleCategories(), [], { initialData: [] as TypeArticleCategory[] }, ); if (isLoading) return ; return (
{categories.map((item, index) => (

{item.title}

))}
); }; export default ArticleHome;