import React, { useMemo } from "react" import { DataNavigation } from "@/components/Common/DataNavigation.tsx" import { Card, Skeleton } from "antd" import { useMessageOption } from "@/hooks/useMessageOption.tsx" import { IodRegistryEntry } from "@/types/iod.ts" import { useIodPlaygroundContext } from "@/components/Option/Playground/PlaygroundIod.tsx" // import { Drawer } from './Drawer.tsx' const defaultData: IodRegistryEntry[] = [ { name: "固态电池固体电解质材料数据集", doId: "CSTR:16666.11.nbsdc.9bjqrscd", description: "国家基础学科公共科学数据中心" }, { name: "固体颗粒物与流体耦合", doId: "CSTR:16666.11.nbsdc.xyzbycl7", description: "清华大学" } ] 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 } const Main: React.FC = ({ data, loading, truncate = true }) => (
{data.map((item, index) => { return ( {loading ? ( ) : (

{item.name}

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

{item.description}

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