260722_01_ENH: 버그 수정 및 개선 사항 수정

This commit is contained in:
2026-07-22 16:53:00 +09:00
parent d8b565276d
commit 2dd5b88c6f
67 changed files with 1925 additions and 736 deletions

View File

@@ -165,12 +165,20 @@ export function DataTable<TData, TValue = unknown>({
const column = header.column
const sorted = column.getIsSorted()
const content = header.isPlaceholder ? null : flexRender(column.columnDef.header, header.getContext())
const maxWidth = column.columnDef.meta?.maxWidth
return (
<TableHead
key={header.id}
className={cn('text-base font-semibold text-foreground', column.id === 'actions' && 'w-[140px] text-center')}
style={{ width: header.getSize() !== 150 ? header.getSize() : undefined }}
className={cn(
'text-base font-semibold text-foreground',
column.id === 'actions' && 'w-[140px] text-center',
maxWidth && 'overflow-hidden text-ellipsis',
)}
style={{
width: header.getSize() !== 150 ? header.getSize() : undefined,
maxWidth,
}}
>
{!header.isPlaceholder && column.getCanSort() ? (
<Button type="button" variant="ghost" className="flex gap-1 px-0 text-base font-semibold" onClick={column.getToggleSortingHandler()}>
@@ -204,7 +212,18 @@ export function DataTable<TData, TValue = unknown>({
row.id === focusRowId && 'bg-accent',
)}
>
{row.getVisibleCells().map((cell) => <TableCell key={cell.id}>{flexRender(cell.column.columnDef.cell, cell.getContext())}</TableCell>)}
{row.getVisibleCells().map((cell) => {
const maxWidth = cell.column.columnDef.meta?.maxWidth
return (
<TableCell
key={cell.id}
className={cn(maxWidth && 'overflow-hidden text-ellipsis')}
style={maxWidth ? { maxWidth } : undefined}
>
{flexRender(cell.column.columnDef.cell, cell.getContext())}
</TableCell>
)
})}
</TableRow>
)) : (
<TableRow><TableCell colSpan={enhancedColumns.length} className="h-24 text-center">{emptyText}</TableCell></TableRow>