import { InfiniteScroller, ResizeContainer, TemplateCardSkeleton, useScrollerContext } from '@gpustack/core-ui'; import { Spin } from 'antd'; import React from 'react'; import backendListCss from '../styles/backend-list.less'; import BackendCard from './backend-card'; interface BackendListProps { defaultSpan?: number; resizable?: boolean; dataList: any[]; loading: boolean; activeId: Global.WithFalse; isFirst: boolean; onSelect?: (item: any) => void; renderItem?: (item: any) => React.ReactNode; } const ListSkeleton: React.FC<{ loading: boolean; isFirst: boolean; }> = ({ loading, isFirst }) => { return (
{loading && (
{isFirst && (
)}
)}
); }; const CardList: React.FC = (props) => { const { dataList, loading, isFirst, defaultSpan = 8, resizable = true, onSelect, renderItem } = props; const { total, current, loading: contextLoading, refresh, throttleDelay } = useScrollerContext(); return ( renderItem ? ( renderItem(item) ) : ( ) } > ); }; export default CardList;