feat: always show undo button in DimensionsView

This commit is contained in:
Christian Vidal Wolf
2026-04-09 09:17:11 +02:00
parent 2ea5bf80aa
commit a5c8076e18
+4 -6
View File
@@ -664,28 +664,26 @@ export function DimensionsView({ data, headers, onEdit, onSaveRow, onCaptureStat
</div> </div>
</td> </td>
<td className="px-4 py-3 text-right"> <td className="px-4 py-3 text-right">
<div className="flex items-center justify-end gap-1 opacity-0 group-hover:opacity-100 transition-opacity"> <div className="flex items-center justify-end gap-1">
<button <button
onClick={() => handleFullSync(group, row)} onClick={() => handleFullSync(group, row)}
title="FULL SYNC: Apply ALL packaging measures labels to all in group" title="FULL SYNC: Apply ALL packaging measures labels to all in group"
disabled={syncing?.key === group.key} disabled={syncing?.key === group.key}
className="p-1.5 hover:bg-blue-600/20 text-slate-500 hover:text-blue-400 rounded transition-all" className="p-1.5 hover:bg-blue-600/20 text-slate-500 hover:text-blue-400 rounded transition-all opacity-0 group-hover:opacity-100"
> >
{syncing?.key === group.key && syncing?.field === 'all' ? <Loader2 className="w-4 h-4 animate-spin" /> : <RefreshCw className="w-4 h-4" />} {syncing?.key === group.key && syncing?.field === 'all' ? <Loader2 className="w-4 h-4 animate-spin" /> : <RefreshCw className="w-4 h-4" />}
</button> </button>
{isPending && (
<button <button
onClick={() => onRevertRow(String(row[COLUMNS.ARTICLE_NO]))} onClick={() => onRevertRow(String(row[COLUMNS.ARTICLE_NO]))}
title="Undo pending changes" title="Undo pending changes"
className="p-1.5 hover:bg-red-600/20 text-slate-500 hover:text-red-400 rounded transition-all" className="p-1.5 hover:bg-red-600/20 text-yellow-500 hover:text-red-400 rounded transition-all"
> >
<Undo2 className="w-4 h-4" /> <Undo2 className="w-4 h-4" />
</button> </button>
)}
<button <button
onClick={() => onEdit(index)} onClick={() => onEdit(index)}
title="Edit product" title="Edit product"
className="p-1.5 hover:bg-slate-600/20 text-slate-500 hover:text-slate-300 rounded transition-all" className="p-1.5 hover:bg-slate-600/20 text-slate-500 hover:text-slate-300 rounded transition-all opacity-0 group-hover:opacity-100"
> >
<Edit2 className="w-4 h-4" /> <Edit2 className="w-4 h-4" />
</button> </button>