other fixes
This commit is contained in:
@@ -974,20 +974,24 @@ export default function TablePageTemplate({
|
||||
}
|
||||
}
|
||||
|
||||
// Determine if we need wrapper divs (for toggle or alignment)
|
||||
const needsWrapper = column.toggleable && hasToggleContent;
|
||||
const alignClass = column.align === 'center' ? 'justify-center' : column.align === 'end' ? 'justify-end' : '';
|
||||
|
||||
return (
|
||||
<TableCell
|
||||
key={column.key}
|
||||
className={`text-${column.align || 'start'} text-gray-800 dark:text-white/90 ${hasActionsInColumn ? 'relative pr-16' : ''}`}
|
||||
>
|
||||
<div className={`flex items-center ${column.align === 'center' ? 'justify-center' : column.align === 'end' ? 'justify-end' : ''} ${column.toggleable && hasToggleContent ? 'justify-between w-full' : ''} gap-2`}>
|
||||
<div className={column.toggleable && hasToggleContent ? 'flex-1' : ''}>
|
||||
{column.render ? (
|
||||
column.render(row[column.key], row)
|
||||
) : (
|
||||
<span>{row[column.key]?.toString() || '-'}</span>
|
||||
)}
|
||||
</div>
|
||||
{column.toggleable && hasToggleContent && (
|
||||
{needsWrapper ? (
|
||||
<div className={`flex items-center ${alignClass} justify-between w-full gap-2`}>
|
||||
<div className="flex-1">
|
||||
{column.render ? (
|
||||
column.render(row[column.key], row)
|
||||
) : (
|
||||
<span>{row[column.key]?.toString() || '-'}</span>
|
||||
)}
|
||||
</div>
|
||||
<div onClick={(e) => e.stopPropagation()}>
|
||||
<ToggleButton
|
||||
isExpanded={isRowExpanded}
|
||||
@@ -997,8 +1001,14 @@ export default function TablePageTemplate({
|
||||
hasContent={hasToggleContent}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
column.render ? (
|
||||
column.render(row[column.key], row)
|
||||
) : (
|
||||
<span>{row[column.key]?.toString() || '-'}</span>
|
||||
)
|
||||
)}
|
||||
|
||||
{/* Actions button - absolutely positioned in column with hasActions flag */}
|
||||
{hasActionsInColumn && (() => {
|
||||
|
||||
Reference in New Issue
Block a user