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: "基于生物基原料,采用repeal2.0可降解材料技术,开发新型环保材料。", doId: "CSTR:13552.11.01.61.2021.742" }, { name: "智能农业解决方案", description: "利用物联网技术,实现精准农业管理,提高农作物产量。", doId: "CSTR:14542.11.01.61.2031.528" }, { name: "新能源汽车电池技术", description: "研发高能量密度、长寿命的新型电池材料,推动电动汽车发展。", doId: "CSTR:147842.11.04.91.2031.680" }, { name: "碳捕集与封存技术", description: "开发高效的碳捕集技术,减少工业排放,助力碳中和目标。", doId: "CSTR:14242.19.11.61.2131.428" } ] 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 PlaygroundScene: React.FC = ({ className }) => { const { iodLoading } = useMessageOption() const { setShowPlayground, setDetailHeader, setDetailMain, currentIodMessage } = useIodPlaygroundContext() const data = useMemo(() => { return currentIodMessage ? currentIodMessage.scenario?.data ?? [] : defaultData }, [currentIodMessage]) const title = useMemo(() => { return currentIodMessage ? "推荐场景" : "热点场景" }, [currentIodMessage]) const showMore = () => { setShowPlayground(false) setDetailHeader(
setShowPlayground(false)} /> ) setDetailMain(
) } return (
{/* 数据导航 */}
{/* 数据列表 */}
) }