🐛 fix: Update Empty component to support border prop and adjust usage in various pages

This commit is contained in:
web
2025-09-23 05:46:21 -07:00
parent bb0a811432
commit ce9ab89c1c
6 changed files with 26 additions and 22 deletions
@@ -100,7 +100,7 @@ export function DocumentButton({ items }: { items: API.Document[] }) {
layoutId={`card-${item.id}-${id}`}
key={`card-${item.id}-${id}`}
onClick={() => setActive(item)}
className='bg-background hover:bg-accent flex cursor-pointer items-center justify-between rounded border p-4'
className='bg-background hover:bg-accent flex cursor-pointer items-center justify-between rounded-xl border p-4'
>
<div className='flex flex-row items-center gap-4'>
<motion.div layoutId={`image-${item.id}-${id}`}>
@@ -35,7 +35,14 @@ export default function Page() {
},
enabled: NEXT_PUBLIC_HIDDEN_TUTORIAL_DOCUMENT !== 'true',
});
if (!DocumentList && !TutorialList) return <Empty />;
if (
(!DocumentList || DocumentList.length === 0) &&
(!TutorialList || TutorialList.length === 0)
) {
return <Empty border />;
}
return (
<div className='space-y-4'>
{DocumentList?.length > 0 && (
@@ -121,7 +121,7 @@ export function TutorialButton({ items }: { items: Item[] }) {
layoutId={`card-${item.title}-${id}`}
key={`card-${item.title}-${id}`}
onClick={() => setActive(item)}
className='bg-background hover:bg-accent flex cursor-pointer items-center justify-between rounded border p-4'
className='bg-background hover:bg-accent flex cursor-pointer items-center justify-between rounded-xl border p-4'
>
<div className='flex flex-row items-center gap-4'>
<motion.div layoutId={`image-${item.title}-${id}`}>