/** * ToolCard 组件 - 工具卡片 * * 用于在仪表盘中展示各个工具功能的卡片组件,支持图标、标题、描述、 * 快照内容展示,具备悬停动画效果。 */ import { ChevronRight } from 'lucide-react'; import type { ComponentType } from 'react'; import type { SvgIconProps } from '@mui/material/SvgIcon'; import type { PaletteColorKey } from '@/config/features'; const PALETTE_COLORS: Record = { primary: '#1976d2', success: '#2e7d32', warning: '#e65100', error: '#c62828', secondary: '#9c27b0', info: '#0288d1', }; interface ToolCardProps { title: string; description?: string; snapshot?: React.ReactNode; colorKey: PaletteColorKey; icon: ComponentType; onClick: () => void; } export default function ToolCard({ title, description, snapshot, colorKey, icon: IconComponent, onClick, }: ToolCardProps) { const colorCode = PALETTE_COLORS[colorKey]; return (
{ e.currentTarget.style.borderColor = colorCode; e.currentTarget.style.boxShadow = `0 12px 24px -10px ${colorCode}33`; }} onMouseLeave={(e) => { e.currentTarget.style.borderColor = ''; e.currentTarget.style.boxShadow = ''; }} >
); } ToolCard.displayName = 'ToolCard';