fix: amélioré layout table versions avec boutons actions

- Augmenté largeur colonne Actions: 100px → 200px
- Optimisé largeurs: Version 200px→180px, Date 120px→140px
- Ajouté flexWrap et gap réduit (0.3) pour boutons
- Hauteur minimum cellules actions: 64px
- Style compact pour bouton Comparer (minWidth auto)
This commit is contained in:
2025-07-24 08:17:33 +04:00
parent c9cf8dcdff
commit b6320806c1
+16 -4
View File
@@ -29,18 +29,18 @@ import {filterVersions, getFilterStats} from '@/lib/version-utils.js'
const columns = [ const columns = [
{ {
width: 200, width: 180,
label: 'Version', label: 'Version',
dataKey: 'name', dataKey: 'name',
}, },
{ {
width: 120, width: 140,
label: 'Créée le', label: 'Créée le',
dataKey: 'date_created', dataKey: 'date_created',
numeric: true, numeric: true,
}, },
{ {
width: 100, width: 200,
label: 'Actions', label: 'Actions',
dataKey: 'actions', dataKey: 'actions',
} }
@@ -108,12 +108,23 @@ function rowContent({
<TableCell <TableCell
key={column.dataKey} key={column.dataKey}
align={column.numeric || false ? 'right' : 'left'} align={column.numeric || false ? 'right' : 'left'}
sx={{
minHeight: column.dataKey === 'actions' ? 64 : 'auto',
verticalAlign: 'middle'
}}
> >
{column.dataKey === 'date_created' {column.dataKey === 'date_created'
? formatDate(row[column.dataKey], 'Pp') ? formatDate(row[column.dataKey], 'Pp')
: (column.dataKey === 'actions' : (column.dataKey === 'actions'
? ( ? (
<Box sx={{display: 'flex', gap: 0.5, alignItems: 'center'}}> <Box sx={{
display: 'flex',
gap: 0.3,
alignItems: 'center',
flexWrap: 'wrap',
justifyContent: 'flex-start'
}}
>
<CopyButton <CopyButton
content={row.delta?.contenu || row.name || ''} content={row.delta?.contenu || row.name || ''}
label='Copier le contenu' label='Copier le contenu'
@@ -138,6 +149,7 @@ function rowContent({
size='small' size='small'
variant='outlined' variant='outlined'
color='primary' color='primary'
sx={{minWidth: 'auto', px: 1}}
onClick={() => handleButtonClick(row.id)} onClick={() => handleButtonClick(row.id)}
> >
Comparer Comparer