UiTable에서 header속성에 align right 이 있을 우측정렬 하도록 수정

This commit is contained in:
YangJinSoo94
2025-04-11 17:38:41 +09:00
parent 21a25de096
commit 0267ffb0d9
@@ -17,6 +17,7 @@ type UiTableProps = {
type UiHeadProps = {
id: string;
title: string;
align?: string;
}
export function UiTable({ tableData, headlist, pageSize, total, children, headName, cellClick, onPageChange, className = '' }: UiTableProps) {
@@ -55,8 +56,16 @@ export function UiTable({ tableData, headlist, pageSize, total, children, headNa
{tableData?.map((el: { [key: string]: any}, index) => (
<TableRow key={index + "row"} >
{headlist?.map((head) => (
// <TableCell className={cellClick&&idx==index?"bg-black/10 cursor-pointer":cellClick?"cursor-pointer":""} onClick={()=>handleCellClick(index)} key={head.id + index}>{el[head.id]}</TableCell>
<TableCell className={cellClick&&idx==index?"opacity-40 cursor-pointer":cellClick?"cursor-pointer":""} onClick={(e)=>handleCellClick(index,head.id)} key={head.id + index}>{el[head.id]}</TableCell>
<TableCell
className={`${head.align === 'right' ? 'text-right' : 'text-center'} ${
cellClick && idx === index ? 'opacity-40 cursor-pointer' :
cellClick ? 'cursor-pointer' : ''
}`}
onClick={() => handleCellClick(index, head.id)}
key={head.id + index}
>
{el[head.id]}
</TableCell>
))}
</TableRow>
))}