Skip to content

Commit 1fed006

Browse files
committed
feat: add summary skeleton
1 parent c399c85 commit 1fed006

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/components/widgets/xlog/XLogSummary.tsx

+10-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,15 @@ const XLogSummary: FC<{
4646

4747
<AutoResizeHeight duration={0.3}>
4848
<p className="text-base-content/85 !m-0 text-sm leading-loose">
49-
{isLoading ? '加载中...' : error ? '请求错误' : data?.data}
49+
{isLoading ? (
50+
<div className="space-y-2">
51+
<span className="block h-5 w-full animate-pulse rounded-xl bg-zinc-200 dark:bg-neutral-800" />
52+
<span className="block h-5 w-full animate-pulse rounded-xl bg-zinc-200 dark:bg-neutral-800" />
53+
<span className="block h-5 w-full animate-pulse rounded-xl bg-zinc-200 dark:bg-neutral-800" />
54+
</div>
55+
) : (
56+
data?.data
57+
)}
5058
</p>
5159
{isLoading && (
5260
<p className="border-slate-200 text-right text-sm dark:border-slate-800 ">
@@ -60,9 +68,8 @@ const XLogSummary: FC<{
6068
</AutoResizeHeight>
6169
</div>
6270
)
63-
console.log(data, cid)
6471

65-
if (!cid || !data?.data) {
72+
if (!cid || error) {
6673
Inner = null
6774
}
6875

0 commit comments

Comments
 (0)