import React, { useState } from 'react' import { useTranslation } from '../i18n' interface FavoriteButtonProps { active?: boolean onChange?: (active: boolean) => void size?: 'sm' | 'md' | 'lg' className?: string } export default function FavoriteButton({ active = false, onChange, size = 'md', className = '' }: FavoriteButtonProps) { const { t } = useTranslation() const [isActive, setIsActive] = useState(active) const [animating, setAnimating] = useState(false) const sizeClasses = { sm: 'w-6 h-6', md: 'w-8 h-8', lg: 'w-10 h-10' } const iconSizes = { sm: 'w-3.5 h-3.5', md: 'w-4 h-4', lg: 'w-5 h-5' } const handleClick = (e: React.MouseEvent) => { e.stopPropagation() const newState = !isActive setIsActive(newState) if (newState) { setAnimating(true) setTimeout(() => setAnimating(false), 400) } onChange?.(newState) } return ( ) }