// 1. Imports externes
import { useState, useEffect } from 'react';
import { clsx } from 'clsx';
// 2. Imports internes (API, hooks, types)
import { toolsApi } from '@/api';
import { useFavorites } from '@/hooks/useFavorites';
import type { EnhancedTool } from '@/api/types';
// 3. Imports composants locaux
import { ToolLogo } from './ToolLogo';
import { PricingBadge } from './PricingBadge';
// 4. Types/Interfaces
interface ToolCardProps {
tool: EnhancedTool;
onClick?: () => void;
}
// 5. Composant
export function ToolCard({ tool, onClick }: ToolCardProps) {
// 5a. Hooks
const { isFavorite, toggleFavorite } = useFavorites();
const [loading, setLoading] = useState(false);
// 5b. Handlers
const handleClick = () => {
onClick?.();
};
// 5c. Effects
useEffect(() => {
// Logic
}, [tool.id]);
// 5d. Render
return (
<div onClick={handleClick}>
{/* JSX */}
</div>
);
}