From 00d40c8410c0c7c94438518344cd7c946cc64879 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Fri, 17 May 2024 19:36:46 +0800 Subject: [PATCH] refactor: add loading state for common list --- src/client/components/CommonList.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/client/components/CommonList.tsx b/src/client/components/CommonList.tsx index 4339c19..b402f19 100644 --- a/src/client/components/CommonList.tsx +++ b/src/client/components/CommonList.tsx @@ -8,6 +8,7 @@ import { Input } from './ui/input'; import { useFuseSearch } from '@/hooks/useFuseSearch'; import { Empty } from 'antd'; import { globalEventBus } from '@/utils/event'; +import { Spinner } from './ui/spinner'; export interface CommonListItem { id: string; @@ -69,6 +70,12 @@ export const CommonList: React.FC = React.memo((props) => {
+ {props.isLoading && ( +
+ +
+ )} + {finalList.length === 0 && !props.isLoading && } {finalList.map((item) => {