Fix syntax error: undefined variable in ForecastView

This commit is contained in:
Christian Vidal Wolf
2026-01-27 22:20:30 +01:00
parent 6b4bef66ec
commit 747b73a9c2
+5 -5
View File
@@ -35,7 +35,7 @@ const Top50Badge: React.FC<{ rank: number; label: string; theme?: 'amber' | 'ind
}; };
const ForecastRow: React.FC<{ const ForecastRow: React.FC<{
item: ForecastViewData; item: ProductForecastData;
activeMonths: string[]; activeMonths: string[];
top50Ranking?: { eu: Map<string, number>; uk: Map<string, number> }; top50Ranking?: { eu: Map<string, number>; uk: Map<string, number> };
stockMap?: Map<string, number>; stockMap?: Map<string, number>;
@@ -471,9 +471,9 @@ const ForecastView: React.FC<ForecastViewProps> = ({ data, filters, top50Ranking
</tr> </tr>
</thead> </thead>
<tbody className="divide-y divide-slate-800"> <tbody className="divide-y divide-slate-800">
{sortedAndFiltered.length > 0 ? ( {sortedProducts.length > 0 ? (
(() => { (() => {
const displayItems = sortedAndFiltered.slice(0, displayCount); const displayItems = sortedProducts.slice(0, displayCount);
return ( return (
<> <>
{displayItems.map(p => ( {displayItems.map(p => (
@@ -485,14 +485,14 @@ const ForecastView: React.FC<ForecastViewProps> = ({ data, filters, top50Ranking
stockMap={stockMap} stockMap={stockMap}
/> />
))} ))}
{displayCount < sortedAndFiltered.length && ( {displayCount < sortedProducts.length && (
<tr> <tr>
<td colSpan={5} className="px-6 py-6 text-center bg-slate-900/40 backdrop-blur-sm border-t border-white/5"> <td colSpan={5} className="px-6 py-6 text-center bg-slate-900/40 backdrop-blur-sm border-t border-white/5">
<button <button
onClick={() => setDisplayCount(prev => prev + 100)} onClick={() => setDisplayCount(prev => prev + 100)}
className="px-6 py-2.5 bg-indigo-600 hover:bg-indigo-500 text-white rounded-xl text-xs font-black uppercase tracking-widest shadow-xl transition-all active:scale-95 border border-indigo-400/30" className="px-6 py-2.5 bg-indigo-600 hover:bg-indigo-500 text-white rounded-xl text-xs font-black uppercase tracking-widest shadow-xl transition-all active:scale-95 border border-indigo-400/30"
> >
Load More SKUs ({sortedAndFiltered.length - displayCount} remaining) Load More SKUs ({sortedProducts.length - displayCount} remaining)
</button> </button>
</td> </td>
</tr> </tr>