{/* Product Info */}
{/* Stats Cards */}
Prix actuel
{currentPrice?.toFixed(2) || '--'}€
Prix minimum
{minPrice?.toFixed(2) || '--'}€
Prix maximum
{maxPrice?.toFixed(2) || '--'}€
Variation
0 ? 'text-red-600' : priceChange < 0 ? 'text-green-600' : ''}`}>
{priceChange > 0 && }
{priceChange < 0 && }
{priceChange === 0 && }
{Math.abs(priceChange).toFixed(1)}%
{/* Chart */}
{loading ? (
) : priceHistory.length > 0 ? (
{renderChart()}
) : (
Aucun historique de prix disponible
)}
{/* History Table */}
{priceHistory.length > 0 && (
| Date |
Prix |
Variation |
{priceHistory.map((entry, index) => {
const prevPrice = index > 0 ? priceHistory[index - 1].price : entry.price;
const change = ((entry.price - prevPrice) / prevPrice * 100);
return (
|
{new Date(entry.timestamp).toLocaleString('fr-FR')}
|
{entry.price.toFixed(2)}€
|
0 ? 'text-red-600' : change < 0 ? 'text-green-600' : ''}`}>
{change !== 0 ? `${change > 0 ? '+' : ''}${change.toFixed(1)}%` : '-'}
|
);
})}
)}