import React, { useMemo } from "react" import { DataNavigation } from "@/components/Common/DataNavigation.tsx" import { Card, Skeleton } from "antd" import { IodRegistryEntry } from "@/types/iod.ts" import { useIodPlaygroundContext } from "@/components/Option/Playground/PlaygroundIod.tsx" const defaultData: IodRegistryEntry[] = [ { name: "北京大学", description: "北大是常为新的,改进的运动的先锋,要使中国向着好的,往上的道路走。", doId: "12100000400002259P" }, { name: "长三角先进材料研究院", description: "由江苏省人民政府联合中国科学院、中国钢研科技集团和中国", doId: "91320507MAEKWL5Y2L" }, { name: "伊利诺伊大学香槟分校(UIUC)", description: "创建于1867年,坐落于伊利诺伊州双子城厄巴纳–香槟市,", doId: "bdware.org/uiuc" } ] type HeaderProps = { title: string showButton?: boolean onClick?: () => void } const Header: React.FC = ({ title, showButton = true, onClick }) => ( {title} } showButton={showButton} onClick={onClick} /> ) type MainProps = { loading: boolean data: IodRegistryEntry[] truncate?: boolean // 水平展示三个还是按列展示(页面和详情展示不一样) flat?: boolean } const Main: React.FC = ({ data, loading, truncate = true, flat = true }) => (
{data.map((item) => { return ( {loading ? ( ) : (

{item.name}

数字对象标识:{item.doId}

{item.description}

)}
) })}
) type Props = { className?: string } export const PlaygroundTeam: React.FC = ({ className }) => { const { iodLoading } = useMessageOption() const { setShowPlayground, setDetailHeader, setDetailMain, currentIodMessage } = useIodPlaygroundContext() const data = useMemo(() => { return currentIodMessage ? currentIodMessage.organization?.data ?? [] : defaultData }, [currentIodMessage]) const title = useMemo(() => { return currentIodMessage ? "推荐团队" : "热点团队" }, [currentIodMessage]) const showMore = () => { setShowPlayground(false) setDetailHeader(
setShowPlayground(false)} /> ) setDetailMain(
) } return (
{/* 数据导航 */}
{/* 数据列表 */}
) }