diff --git a/apps/admin/src/components/ReservationTable/ReservationTable.styles.ts b/apps/admin/src/components/ReservationTable/ReservationTable.styles.ts index 509435ef..380ae840 100644 --- a/apps/admin/src/components/ReservationTable/ReservationTable.styles.ts +++ b/apps/admin/src/components/ReservationTable/ReservationTable.styles.ts @@ -100,6 +100,11 @@ const Item = styled.span` } `; +const DisabledText = styled.span` + ${({ theme }) => theme.typo.b2}; + color: ${({ theme }) => theme.palette.grey.g30}; +`; + const Empty = styled.div` display: flex; flex-direction: column; @@ -146,6 +151,7 @@ export default { HeaderRow, Row, Item, + DisabledText, Empty, ResetButton, TooltipItemColumn, diff --git a/apps/admin/src/components/ReservationTable/index.tsx b/apps/admin/src/components/ReservationTable/index.tsx index 1e0ff72b..8d1c2585 100644 --- a/apps/admin/src/components/ReservationTable/index.tsx +++ b/apps/admin/src/components/ReservationTable/index.tsx @@ -102,18 +102,23 @@ const getColumns = (ticketStatus: TicketStatus) => [ : []), columnHelper.accessor( (row) => { - if (ticketStatus === 'CANCEL') { - return row.cancelInfo?.canceledAt; + if (ticketStatus === 'CANCEL' && row.cancelInfo) { + return { type: 'date', value: row.cancelInfo.canceledAt }; } - return row.createdAt; + return row.gift && !row.gift.done + ? { type: 'text', value: '아직 선물이 등록되지 않았습니다.' } + : { type: 'date', value: row.createdAt }; }, { header: ticketStatus === 'CANCEL' ? '취소 일시' : '결제 일시', cell: (props) => { - const value = props.getValue(); - if (value) { - return format(value, 'yyyy/MM/dd HH:mm'); + const { type, value } = props.getValue(); + switch (type) { + case 'date': + return format(value, 'yyyy/MM/dd HH:mm'); + case 'text': + return {value}; } return '-'; }, diff --git a/packages/api/src/types/show.ts b/packages/api/src/types/show.ts index 12b08ca8..64914cb1 100644 --- a/packages/api/src/types/show.ts +++ b/packages/api/src/types/show.ts @@ -117,6 +117,15 @@ export interface CancelInfoResponse { canceledAt: string; } +export interface GiftResponseV2 { + /** 선물 ID */ + id: number; + /** 선물 수신 완료 여부 */ + done: boolean; + /** 선물 생성 일시 */ + createdAt: string; +} + export interface ReservationWithTicketsResponse { /** 예매 ID */ reservationId: number; @@ -124,8 +133,8 @@ export interface ReservationWithTicketsResponse { csReservationId: number; /** 예매 결제 관리 상태 */ paymentManagementStatus: TicketStatus; - /** 선물 여부 */ - gift: boolean; + /** 선물 정보 선물이 아니면 null */ + gift?: GiftResponseV2; /** 판매 티켓 타입 정보. 만약 삭제된 경우 null */ salesTicketType?: SalesTicketTypeResponseV2; /** 티켓 정보 목록. */