diff --git a/src/components/Common/Playground/IodRelevant.tsx b/src/components/Common/Playground/IodRelevant.tsx index 237ab36..5b979b6 100644 --- a/src/components/Common/Playground/IodRelevant.tsx +++ b/src/components/Common/Playground/IodRelevant.tsx @@ -235,25 +235,28 @@ export const PlaygroundIodRelevant: React.FC = ({ className }) => { (message) => message.id === currentMessageId ) - const text = (iodSearch && iodLoading) ? '正' : '已' - const text2 = (iodSearch && iodLoading) ? '进行' : '完成' - const text3 = (iodSearch && iodLoading) ? '……' : '' + const loading = (iodSearch && iodLoading) + const text = loading ? '正' : '已' + const text2 = loading ? '进行' : '完成' + const text3 = loading ? '……' : '' + const duration = loading ? 2.5 : 0 + return [ { title: (

{text}在 - 个 + 国家和省部级科学数据中心、 {" "} - 所 + 高等院校的 - + 万个 科学数据集中{text2}搜索{text3} @@ -282,12 +285,12 @@ export const PlaygroundIodRelevant: React.FC = ({ className }) => {

{text}在 - + 万篇 学术论文、 - + 万个 数据项目中{text2}搜索{text3} @@ -316,17 +319,17 @@ export const PlaygroundIodRelevant: React.FC = ({ className }) => {

{text}在 - 家 + 高等院校和科研机构、 {" "} - 万 + 家科技型企业、 {" "} - 万 + 科技人才中{text2}搜索{text3}

diff --git a/src/components/Option/Playground/PlaygroundIod.tsx b/src/components/Option/Playground/PlaygroundIod.tsx index 1d041c4..e6ab985 100644 --- a/src/components/Option/Playground/PlaygroundIod.tsx +++ b/src/components/Option/Playground/PlaygroundIod.tsx @@ -19,7 +19,7 @@ interface IodPlaygroundContextType { setDetailHeader: React.Dispatch> detailMain: React.ReactNode setDetailMain: React.Dispatch> - currentMessage: Message | null + currentIodMessage: Message | null } // 创建 Context @@ -38,7 +38,9 @@ export const useIodPlaygroundContext = () => { return context } -export const PlaygroundIod = () => { +const PlaygroundIodProvider: React.FC<{ children: React.ReactNode }> = ({ + children +}) => { const { messages, iodLoading, currentMessageId, iodSearch } = useMessageOption() @@ -46,7 +48,7 @@ export const PlaygroundIod = () => { const [detailHeader, setDetailHeader] = useState(<>) const [detailMain, setDetailMain] = useState(<>) - const currentMessage = useMemo(() => { + const currentIodMessage = useMemo(() => { if (iodLoading) { return null } @@ -73,7 +75,7 @@ export const PlaygroundIod = () => { return ( { detailHeader, setDetailHeader }}> -
- -
+ {children}
) } @@ -111,7 +111,9 @@ const PlaygroundContent = () => { className="h-full grid grid-rows-12 gap-3">
@@ -151,3 +153,14 @@ const PlaygroundContent = () => { ) } + + +export const PlaygroundIod = () => { + return ( +
+ + + +
+ ) +}