mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-06 08:50:50 +08:00
feat(core): lazy load doc card (#9192)
This commit is contained in:
@@ -102,30 +102,35 @@ export const DocCard = forwardRef<HTMLAnchorElement, DocCardProps>(
|
|||||||
data-visible={visible}
|
data-visible={visible}
|
||||||
{...attrs}
|
{...attrs}
|
||||||
>
|
>
|
||||||
<header className={styles.head} data-testid="doc-card-header">
|
{visible && (
|
||||||
<h3 className={styles.title}>{title}</h3>
|
<>
|
||||||
<IconButton
|
<header className={styles.head} data-testid="doc-card-header">
|
||||||
aria-label="favorite"
|
<h3 className={styles.title}>{title}</h3>
|
||||||
icon={
|
<IconButton
|
||||||
<IsFavoriteIcon onClick={toggleFavorite} favorite={favorited} />
|
aria-label="favorite"
|
||||||
}
|
icon={
|
||||||
/>
|
<IsFavoriteIcon
|
||||||
</header>
|
onClick={toggleFavorite}
|
||||||
<main className={styles.content} style={contentStyle}>
|
favorite={favorited}
|
||||||
{visible && (
|
/>
|
||||||
<PagePreview
|
}
|
||||||
fallback={
|
/>
|
||||||
<>
|
</header>
|
||||||
<Skeleton />
|
<main className={styles.content} style={contentStyle}>
|
||||||
<Skeleton width={'60%'} />
|
<PagePreview
|
||||||
</>
|
fallback={
|
||||||
}
|
<>
|
||||||
pageId={meta.id}
|
<Skeleton />
|
||||||
emptyFallback={<div className={styles.contentEmpty}>Empty</div>}
|
<Skeleton width={'60%'} />
|
||||||
/>
|
</>
|
||||||
)}
|
}
|
||||||
</main>
|
pageId={meta.id}
|
||||||
{showTags ? <DocCardTags docId={meta.id} rows={2} /> : null}
|
emptyFallback={<div className={styles.contentEmpty}>Empty</div>}
|
||||||
|
/>
|
||||||
|
</main>
|
||||||
|
{showTags ? <DocCardTags docId={meta.id} rows={2} /> : null}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</WorkbenchLink>
|
</WorkbenchLink>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user