File tree 7 files changed +189
-289
lines changed
7 files changed +189
-289
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,16 @@ const TestProgressPanel = ({
237
237
) ;
238
238
} ;
239
239
240
+ // 添加 LoadingState 组件
241
+ const LoadingState = ( { t } : { t : ( key : string ) => string } ) => (
242
+ < div className = "flex flex-col items-center justify-center py-12 px-4" >
243
+ < div className = "h-12 w-12 rounded-full border-4 border-primary/10 border-t-primary animate-spin mb-4" />
244
+ < h3 className = "text-lg font-medium text-foreground/70" >
245
+ { t ( "models.loading" ) }
246
+ </ h3 >
247
+ </ div >
248
+ ) ;
249
+
240
250
export default function ModelsPage ( ) {
241
251
const { t } = useTranslation ( "common" ) ;
242
252
const [ models , setModels ] = useState < Model [ ] > ( [ ] ) ;
@@ -905,26 +915,28 @@ export default function ModelsPage() {
905
915
{ /* 桌面端表格视图 */ }
906
916
< div className = "hidden sm:block" >
907
917
< div className = "rounded-xl border border-border/40 bg-card shadow-sm overflow-hidden" >
908
- < Table
909
- columns = { columns }
910
- dataSource = { models }
911
- rowKey = "id"
912
- loading = { loading }
913
- pagination = { false }
914
- size = "middle"
915
- className = { tableClassName }
916
- scroll = { { x : 500 } }
917
- rowClassName = { ( ) => "group" }
918
- />
918
+ { loading ? (
919
+ < LoadingState t = { t } />
920
+ ) : (
921
+ < Table
922
+ columns = { columns }
923
+ dataSource = { models }
924
+ rowKey = "id"
925
+ loading = { false }
926
+ pagination = { false }
927
+ size = "middle"
928
+ className = { tableClassName }
929
+ scroll = { { x : 500 } }
930
+ rowClassName = { ( ) => "group" }
931
+ />
932
+ ) }
919
933
</ div >
920
934
</ div >
921
935
922
936
{ /* 移动端卡片视图 */ }
923
937
< div className = "sm:hidden" >
924
938
{ loading ? (
925
- < div className = "flex justify-center py-12" >
926
- < div className = "w-8 h-8 border-3 border-primary/20 border-t-primary animate-spin rounded-full" > </ div >
927
- </ div >
939
+ < LoadingState t = { t } />
928
940
) : (
929
941
< div className = "grid gap-4" >
930
942
{ models . map ( ( model ) => (
You can’t perform that action at this time.
0 commit comments