other fixes

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-19 12:47:50 +00:00
parent 6c7395262f
commit 011ecefd1b
7 changed files with 30 additions and 17 deletions

View File

@@ -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 && (() => {