Remove decimals from Dashboard and fix BuyBox badge layout

This commit is contained in:
christian.vidal
2026-01-29 20:19:13 +01:00
parent 0211124879
commit 55c91a7bfc
2 changed files with 9 additions and 7 deletions
+3 -3
View File
@@ -27,10 +27,10 @@ export const BuyBoxWarningBadge: React.FC<BuyBoxWarningBadgeProps> = ({ asin, bu
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}
>
<div className="inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-amber-500/20 border border-amber-500/50 text-amber-400 text-[9px] font-bold uppercase tracking-tight cursor-help transition-all hover:bg-amber-500/30 hover:scale-105">
<span className="text-xs"></span>
<div className="inline-flex items-center gap-1 px-1.5 h-5 rounded bg-amber-500/20 border border-amber-500/50 text-amber-400 text-[9px] font-bold uppercase tracking-tight cursor-help transition-all hover:bg-amber-500/30 hover:scale-105 whitespace-nowrap">
<span className="text-xs leading-none"></span>
<span>BB Lost</span>
<span className="text-amber-300/80">{data.countries.join(', ')}</span>
<span className="text-amber-300/80">{data.countries.slice(0, 3).join(', ')}{data.countries.length > 3 ? '...' : ''}</span>
</div>
{/* Hover Popup */}
+6 -4
View File
@@ -91,7 +91,9 @@ const MultiYearKPICard: React.FC<{
const formatValue = (val: number) => {
if (metric === 'sellOut') {
return `${val.toLocaleString('de-DE', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
if (metric === 'sellOut') {
return `${val.toLocaleString('de-DE', { minimumFractionDigits: 0, maximumFractionDigits: 0 })}`;
}
}
return val.toLocaleString('de-DE');
};
@@ -166,7 +168,7 @@ const MultiYearKPICard: React.FC<{
{contextGrowthElement}
{/* Share of Line % */}
<span className="text-indigo-400 font-bold border-l border-slate-700 pl-2 ml-2 whitespace-nowrap">
{((currentValue / contextValue) * 100).toFixed(1)}% Share
{((currentValue / contextValue) * 100).toFixed(0)}% Share
</span>
</div>
</div>
@@ -424,7 +426,7 @@ const GrowthTable: React.FC<{
</td>
<td className="px-4 py-2 text-right">
<span className={`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${item.sellOutGrowthPercentage >= 0 ? 'bg-emerald-500/10 text-emerald-400' : 'bg-red-500/10 text-red-400'}`}>
{item.sellOutGrowthPercentage.toFixed(1)}%
{item.sellOutGrowthPercentage.toFixed(0)}%
</span>
</td>
@@ -436,7 +438,7 @@ const GrowthTable: React.FC<{
</td>
<td className="px-4 py-2 text-right">
<span className={`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${item.unitsGrowthPercentage >= 0 ? 'bg-violet-500/10 text-violet-400' : 'bg-orange-500/10 text-orange-400'}`}>
{item.unitsGrowthPercentage.toFixed(1)}%
{item.unitsGrowthPercentage.toFixed(0)}%
</span>
</td>
</tr>