feat: implement ArticleList component with pagination and loading skeleton
This commit is contained in:
33
src/ui/components/internal/article/article-list-skeleton.tsx
Normal file
33
src/ui/components/internal/article/article-list-skeleton.tsx
Normal 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>
|
||||
</>
|
||||
);
|
||||
Reference in New Issue
Block a user