// src/components/logo-animation/LogoAnimation.tsx import React from 'react'; import cn from 'classnames'; // آیکون انسان const SvgHumanIcon = () => ( ); // *** تعریف logoColorConfig باید در همین فایل و قبل از استفاده باشد *** const logoColorConfig = { blue: { ping: "bg-blue-200 dark:bg-blue-700", ring1: "bg-blue-200 dark:bg-blue-700", ring2: "bg-blue-300 dark:bg-blue-600", ring3: "bg-blue-400 dark:bg-blue-500", }, green: { ping: "bg-green-200 dark:bg-green-700", ring1: "bg-green-200 dark:bg-green-700", ring2: "bg-green-300 dark:bg-green-600", ring3: "bg-green-400 dark:bg-green-500", }, gray: { // <-- اطمینان از وجود کلید 'gray' ping: "bg-gray-200 dark:bg-gray-700", ring1: "bg-gray-200 dark:bg-gray-700", ring2: "bg-gray-300 dark:bg-gray-600", ring3: "bg-gray-400 dark:bg-gray-500", } }; interface LogoAnimationProps { isMini: boolean; isActive: boolean; type?: 'human' | 'ai'; forFooter?: boolean; } const LogoAnimation: React.FC = ({ isMini, isActive, type = 'human', forFooter = false, }) => { if (!isActive) return null; const colorKey = type === 'human' ? 'blue' : (type === 'ai' ? 'green' : 'gray'); // اینجا TypeScript باید نوع logoColorConfig را بشناسد const currentColors = logoColorConfig[colorKey as keyof typeof logoColorConfig] || logoColorConfig.gray; const size = isMini ? 80 : 200; const iconDisplaySize = isMini ? 35 : 70; const iconInset = (size - iconDisplaySize) / 2; const insets = { ping: isMini ? "10px" : "40px", ring1: isMini ? "0px" : "0px", ring2: isMini ? "5px" : "20px", ring3: isMini ? "12px" : "50px", iconContainer: `${iconInset}px` }; const IconComponent = type === 'human' ? SvgHumanIcon : null; return ( {/* div مخفی برای safelist کردن کلاسهای Tailwind */} {IconComponent && } ); }; export default LogoAnimation;