import React, { useMemo } from "react" import { Avatar, Card } from "antd" import { AnimatePresence, motion } from "framer-motion" // 使用 CSS-in-JS 方式 import styled, { keyframes } from "styled-components" import CountUp from "react-countup" import { TalentPoolIcon } from "@/components/Icons/TalentPool .tsx" import { ResearchPaperIcon } from "@/components/Icons/ResearchPaper.tsx" import { DataProjectIcon } from "@/components/Icons/DataProject.tsx" import { DatasetIcon } from "@/components/Icons/Dataset.tsx" import { TechCompanyIcon } from "@/components/Icons/TechCompany.tsx" import { ResearchInstitutesIcon } from "@/components/Icons/ResearchInstitutes.tsx" import { NSDCIcon } from "@/components/Icons/NSDC.tsx" const rotate = keyframes` 0% { transform: translate(-50%, -50%) rotate(0deg); } 100% { transform: translate(-50%, -50%) rotate(360deg); } ` const breathe = keyframes` 0% { box-shadow: 0 0 5px rgba(37, 231, 232, 0.3); } 50% { box-shadow: 0 0 20px rgba(37, 231, 232, 0.8); } 100% { box-shadow: 0 0 5px rgba(37, 231, 232, 0.3); } ` // 花瓣 const CircleElement = styled.div<{ delay: number; playing: boolean }>` position: absolute; width: 300px; height: 160px; background: #3b82f6; // blue-500 opacity: 0.2; border-radius: 50%; top: 55%; left: 50%; animation: ${rotate} 6s linear infinite, ${breathe} 2s infinite alternate; animation-delay: ${(props) => props.delay}s; animation-play-state: ${(props) => (props.playing ? "running" : "paused")}; animation-duration: 3s; /* 添加动画总持续时间 */ animation-fill-mode: forwards; /* 保持动画结束时的状态 */ ` const FrostedGlassCard = styled(Card)` background: rgba(255, 255, 255, 0.25) !important; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.18); ` const SuccessIcon = React.forwardRef< SVGSVGElement, React.SVGProps >((props, ref) => { return ( ) }) const LoadingIcon = React.forwardRef< SVGSVGElement, React.SVGProps >((props, ref) => { return ( ) }) const SearchIcon = () => { return ( ) } // 自定义统计卡片组件 const StatCard: React.FC<{ number: number unit?: string label: string decimals?: number icon: React.ReactNode }> = ({ number, unit, label, decimals, icon }) => { return (
{unit}
{" "} {label}
) } export const StatisticGrid: React.FC = () => { return (
{/* 第一行:3 个卡片 */}
} number={11} unit="家" label="国家科学数据中心" /> } number={763} unit="家" label="高等院校和科研机构" /> } number={2.1} decimals={1} unit="万" label="科技型企业" />
{/* 第二行:4 个卡片 */}
} number={537163} label="数据集" /> } number={183729} label="数据项目" /> } number={1380026} label="数据论文" /> } number={2} unit="万" label="科创人才" />
) } type Props = { className?: string } export const PlaygroundIodRelevant: React.FC = ({ className }) => { const { messages, iodLoading, currentMessageId, iodSearch } = useMessageOption() const showSearchData = useMemo(() => { return iodSearch && messages.length > 0 && !iodLoading }, [iodSearch, messages, iodLoading]) const data = useMemo(() => { const currentMessage = messages?.find( (message) => message.id === currentMessageId ) const loading = (iodSearch && iodLoading) const text = loading ? '正' : '已' const text2 = loading ? '进行' : '完成' const text3 = loading ? '……' : '' const duration = loading ? 2.5 : 0 return [ { title: (

{text}在 国家和省部级科学数据中心、 {" "} 高等院校的 万个 科学数据集中{text2}搜索{text3}

), description: showSearchData ? (

已发现 {" "} 个{" "} 数据集

) : ( "" ) }, { title: (

{text}在 万篇 学术论文、 万个 数据项目中{text2}搜索{text3}

), description: showSearchData ? (

已发现 {" "} 个{" "} 场景

) : ( "" ) }, { title: (

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

), description: showSearchData ? (

已发现 {" "} 个{" "} 组织

) : ( "" ) } ] }, [messages, iodLoading]) return (
{/* 花瓣效果 */}
{/* Header */}

{messages.length > 0 ? "科创数联网深度搜索" : "科创数联网连接资源"}
{/**/}

{messages.length > 0 ? "下面是在科创数联网上进行深度搜索得到的相关数据、场景和团队" : "下面是科创数联网连接的数据、场景和团队"}

{/* Content */}
{messages.length ? ( {data.map((item, index) => (
{iodSearch && iodLoading ? ( ) : ( )}

{item.title}

{item.description && (

{item.description}

)}
))}
) : ( )}
) }