fix: modelscope api incorrect

This commit is contained in:
jialin
2025-11-21 13:43:39 +08:00
parent 19babbc73d
commit 3f63831488
5 changed files with 34 additions and 42 deletions
@@ -1,3 +1,6 @@
import { DoubleRightOutlined } from '@ant-design/icons';
import { useIntl } from '@umijs/max';
import { Button } from 'antd';
import React from 'react';
import {
@@ -9,13 +12,38 @@ const InfiniteScroller: React.FC<
UseInfiniteScrollOptions & { children: React.ReactNode }
> = (props) => {
const { children, ...restProps } = props;
const { observerRef } = useInfiniteScroll(restProps);
const intl = useIntl();
const { observerRef, throttledLoadMore } = useInfiniteScroll(restProps);
return (
<div>
{children}
<div ref={observerRef} style={{ height: 1 }}>
<span></span>
<div
ref={observerRef}
style={{
height: 1
}}
>
{restProps.current < restProps.total && (
<div
style={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
marginTop: 24
}}
>
<Button
onClick={throttledLoadMore}
type="text"
size="small"
disabled={restProps.loading}
>
{intl.formatMessage({ id: 'common.button.more' })}
<DoubleRightOutlined rotate={90} />
</Button>
</div>
)}
</div>
</div>
);
@@ -45,5 +45,5 @@ export function useInfiniteScroll({
}
}, [inView, throttledLoadMore]);
return { observerRef };
return { observerRef, throttledLoadMore };
}