mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 14:55:24 +02:00
refactor: eliminate automatic 'End of Life' (EOL) logic and yellow highlighting for OOC products with no stock
This commit is contained in:
@@ -184,14 +184,6 @@ export function ProductDescriptions({ data, headers, asinColumnIndex, onEdit, ro
|
||||
};
|
||||
|
||||
const getRowColor = (row: ExcelRow) => {
|
||||
// EOL Rule: OOC Classification and 0 or negative stock (Item Available)
|
||||
const classification = String(row[COLUMNS.CLASSIFICATION] || '').toUpperCase().trim();
|
||||
const stock = Number(row[COLUMNS.ITEM_AVAILABLE] || 0);
|
||||
|
||||
if (classification === 'OOC' && stock <= 0) {
|
||||
return 'bg-yellow-500/10 hover:bg-yellow-500/20'; // EOL Highlight
|
||||
}
|
||||
|
||||
const fields = [
|
||||
row[COLUMNS.LONG_DE], row[COLUMNS.LONG_EN],
|
||||
row[COLUMNS.SHORT_DE], row[COLUMNS.SHORT_EN]
|
||||
@@ -205,13 +197,7 @@ export function ProductDescriptions({ data, headers, asinColumnIndex, onEdit, ro
|
||||
const Badge = ({ content, row }: { content: any, row: ExcelRow }) => {
|
||||
if (content !== undefined && content !== null && content !== '') return <span className="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-green-500/20 text-green-400 border border-green-500/30">✓</span>;
|
||||
|
||||
// EOL Exception: OOC and stock <= 0
|
||||
const classification = String(row[COLUMNS.CLASSIFICATION] || '').toUpperCase().trim();
|
||||
const stock = Number(row[COLUMNS.ITEM_AVAILABLE] || 0);
|
||||
|
||||
if (classification === 'OOC' && stock <= 0) {
|
||||
return <span className="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-500/20 text-yellow-400 border border-yellow-500/30">EOL not neccessary</span>;
|
||||
}
|
||||
|
||||
return <span className="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-red-500/20 text-red-400 border border-red-500/30">✗ Missing</span>;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user