style: adjust ASIN column width to fit 10 characters in ProductDescriptions

This commit is contained in:
Christian Vidal Wolf
2026-04-10 09:28:49 +02:00
parent 161e77a76b
commit 7bf37eb017
+4 -4
View File
@@ -29,9 +29,9 @@ export function ProductDescriptions({ data, headers, asinColumnIndex, onEdit, ro
const [columnFilters, setColumnFilters] = useState<Record<number, string[]>>({});
const [openFilterCol, setOpenFilterCol] = useState<number | null>(null);
const [columnWidths, setColumnWidths] = useState<Record<number, number>>({
[COLUMNS.ARTICLE_NO]: 100,
[COLUMNS.ARTICLE_NAME]: 250,
[COLUMNS.ASIN]: asinColumnIndex !== null ? 90 : 0,
[COLUMNS.ARTICLE_NO]: 110,
[COLUMNS.ARTICLE_NAME]: 450, // More flexible space for name
...(asinColumnIndex !== null ? { [asinColumnIndex]: 100 } : {}),
[COLUMNS.LINE]: 80,
[COLUMNS.LICENSE]: 120,
[COLUMNS.CLASSIFICATION]: 100,
@@ -366,7 +366,7 @@ export function ProductDescriptions({ data, headers, asinColumnIndex, onEdit, ro
<td className="px-4 py-3 font-mono text-slate-300 text-xs truncate" style={{ width: columnWidths[COLUMNS.ARTICLE_NO] }}>{row[COLUMNS.ARTICLE_NO]}</td>
<td className="px-4 py-3 font-medium text-white truncate" style={{ width: columnWidths[COLUMNS.ARTICLE_NAME] }} title={row[COLUMNS.ARTICLE_NAME]}>{row[COLUMNS.ARTICLE_NAME]}</td>
{asinColumnIndex !== null && (
<td className="px-4 py-3 font-mono text-slate-300 text-xs truncate" style={{ width: columnWidths[asinColumnIndex] || 90 }} title={row[asinColumnIndex]}>{row[asinColumnIndex] || '—'}</td>
<td className="px-4 py-3 font-mono text-slate-300 text-xs truncate" style={{ width: columnWidths[asinColumnIndex] || 100 }} title={row[asinColumnIndex]}>{row[asinColumnIndex] || '—'}</td>
)}
<td className="px-4 py-3 text-slate-300 text-xs truncate" style={{ width: columnWidths[COLUMNS.LINE] }}>{row[COLUMNS.LINE]}</td>
<td className="px-4 py-3 text-slate-300 text-xs truncate" style={{ width: columnWidths[COLUMNS.LICENSE] }} title={row[COLUMNS.LICENSE]}>{row[COLUMNS.LICENSE] || '—'}</td>