feat: implement ArticleList component with pagination and loading skeleton

This commit is contained in:
2026-04-11 21:37:39 -03:00
parent 56a5d77c6c
commit 79e6fae0f9
7 changed files with 140 additions and 88 deletions

View File

@@ -0,0 +1,33 @@
export const ArticleCardSkeleton = () => (
<div className='flex flex-col overflow-hidden rounded-xl border border-border bg-card'>
<div className='aspect-video w-full animate-pulse bg-muted' />
<div className='flex flex-1 flex-col gap-3 p-5'>
<div className='h-3 w-24 animate-pulse rounded bg-muted' />
<div className='space-y-1.5'>
<div className='h-4 w-full animate-pulse rounded bg-muted' />
<div className='h-4 w-3/4 animate-pulse rounded bg-muted' />
</div>
<div className='flex-1 space-y-1.5'>
<div className='h-3 w-full animate-pulse rounded bg-muted' />
<div className='h-3 w-full animate-pulse rounded bg-muted' />
<div className='h-3 w-2/3 animate-pulse rounded bg-muted' />
</div>
<div className='mt-1 h-3 w-16 animate-pulse rounded bg-muted' />
</div>
</div>
);
export const ArticleListSkeleton = ({
skeletonSize,
}: {
skeletonSize: number;
}) => (
<>
<div className='mb-10 h-4 w-32 animate-pulse rounded bg-muted' />
<div className='grid gap-6 sm:grid-cols-2 xl:grid-cols-3'>
{Array.from({ length: skeletonSize }).map((_, i) => (
<ArticleCardSkeleton key={i} />
))}
</div>
</>
);