- TableSection에서 컬럼 설정(tableColumns)·날짜 유틸(datetime) 분리 - PageSection → Pagination 개명, 인라인 SVG를 paginationIcons로 분리 - 상태 색상 정비: 협상중=강조(다크), 미참여=회색, 나머지 의미색 유지 - 활성 페이지·목데이터 격리(mocks), 페이지 크기 20 복구, 주석 정리 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
46 lines
1.6 KiB
TypeScript
46 lines
1.6 KiB
TypeScript
import { type ReactNode } from 'react'
|
|
import { formatDateTime } from '@/features/list/lib/datetime'
|
|
import type { ListItem } from '@/features/list/types'
|
|
|
|
// 컬럼 설정 (렌더링은 TableSection)
|
|
export interface Column {
|
|
key: keyof ListItem
|
|
label: string
|
|
width: string
|
|
align: 'text-left' | 'text-center'
|
|
render?: (item: ListItem) => ReactNode
|
|
}
|
|
|
|
const STATUS_COLOR: Record<string, string> = {
|
|
협상생성: 'text-info font-semibold',
|
|
협상중: 'text-foreground font-semibold',
|
|
협상완료: 'text-success font-semibold',
|
|
미참여: 'text-muted-foreground font-semibold',
|
|
협상거부: 'text-destructive font-semibold',
|
|
}
|
|
|
|
export const COLUMNS: Column[] = [
|
|
{ key: 'item_code', label: '상품코드', width: 'w-[8.39%]', align: 'text-center' },
|
|
{
|
|
key: 'session_status',
|
|
label: '상태',
|
|
width: 'w-[6.57%]',
|
|
align: 'text-center',
|
|
render: (item) => (
|
|
<span className={STATUS_COLOR[item.session_status]}>{item.session_status || '-'}</span>
|
|
),
|
|
},
|
|
{ key: 'qt_number', label: '견적번호', width: 'w-[14.29%]', align: 'text-center' },
|
|
{ key: 'qt_type', label: '구분', width: 'w-[5.52%]', align: 'text-center' },
|
|
{ key: 'item_name', label: '상품명', width: 'w-[20.96%]', align: 'text-left' },
|
|
{ key: 'model_name', label: '모델명', width: 'w-[22.89%]', align: 'text-left' },
|
|
{ key: 'maker_name', label: '제조사', width: 'w-[8.67%]', align: 'text-center' },
|
|
{
|
|
key: 'qt_end_time',
|
|
label: '마감일',
|
|
width: 'w-[13.72%]',
|
|
align: 'text-center',
|
|
render: (item) => formatDateTime(item.qt_end_time),
|
|
},
|
|
]
|