import type { ReactNode } from "react";
import { IconKitSvg } from "./IconKitSvg";
import "./loading.css";
export function SystemLoading({
variant = "page",
state = "loading",
title = "正在加载",
description = "正在同步最新数据,请稍候。",
icon = "activity",
reference,
actions,
}: {
variant?: "inline" | "page" | "fullscreen";
state?: "loading" | "error";
title?: string;
description?: string;
icon?: string;
reference?: string;
actions?: ReactNode;
}) {
return (
+
+
+
+
[ AIRSHELF / SYSTEM ]
{state === "error" ? "[ CONNECTION ERROR ]" : "[ SYNCING ]"}
{state === "loading" && }
{actions ? (
{actions}
) : state === "loading" ? (
) : null}
{reference ? `// REF · ${reference}` : "// DATA SYNC"}
{state === "error" ? "RETRY AVAILABLE" : "DATA HYDRATION"}
);
}
// 列表数据在途时的骨架屏(grid 卡片 / 行),替代「为空」状态,让用户看到「加载中」而非「没数据」。
export function SkeletonGrid({ count = 8 }: { count?: number }) {
return (
// 加载中…
{Array.from({ length: count }).map((_, i) => (
))}
);
}
export function SkeletonRows({ count = 6 }: { count?: number }) {
return (
// 加载中…
{Array.from({ length: count }).map((_, i) => (
))}
);
}