'use client'; import { Card, CardActionArea, CardContent, CardMedia, Typography, Box, Chip, useTheme, alpha } from '@mui/material'; import LaunchIcon from '@mui/icons-material/Launch'; import StorageIcon from '@mui/icons-material/Storage'; import { useTranslation } from 'react-i18next'; export function DatasetSiteCard({ site }) { const { name, link, description, image, labels } = site; const theme = useTheme(); // 处理图片路径,如果没有图片则使用默认图片 const imageUrl = image || `/imgs/default-dataset.png`; const { t } = useTranslation(); // 处理卡片点击 const handleCardClick = () => { window.open(link, '_blank'); }; return ( {/* 网站截图 */} } label={t('datasetSquare.dataset')} size="small" sx={{ position: 'absolute', top: 10, right: 10, zIndex: 2, backgroundColor: alpha(theme.palette.background.paper, 0.8), backdropFilter: 'blur(4px)', border: `1px solid ${alpha(theme.palette.primary.main, 0.2)}`, '& .MuiChip-icon': { color: theme.palette.primary.main } }} /> {/* 网站信息 */} {name} {description} {/* 标签显示 */} {labels && labels.length > 0 && ( {labels.map((label, index) => ( ))} )} ); }