|
| 1 | +import ItemTokenList from '@/common/components/ItemTokenList'; |
| 2 | +import getImageUrl from '@/common/utils/getImageUrl'; |
| 3 | +import PriceToken from '@/features/home/components/ItemCard/PriceToken'; |
| 4 | +import * as s from './style.css'; |
| 5 | +import TradeInfo from '../TradeInfo'; |
| 6 | +import Btn from '../Btn'; |
| 7 | +import type { AppointmentInterface } from '../../types'; |
| 8 | +import { Link } from 'react-router'; |
| 9 | +import { parsePickDate } from '@/common/utils/parseDate'; |
| 10 | + |
| 11 | +interface PickItemListProps { |
| 12 | + data: AppointmentInterface; |
| 13 | +} |
| 14 | + |
| 15 | +const PickItemList = ({ data }: PickItemListProps) => { |
| 16 | + const isSuccess = data.state === 'SUCCESS'; |
| 17 | + const date = parsePickDate(data.rentalDate); |
| 18 | + |
| 19 | + return ( |
| 20 | + <div className={s.TradeInfo}> |
| 21 | + <TradeInfo isSuccess={isSuccess} date={date} /> |
| 22 | + <Link className={s.Container} to={`/pick-detail/${data.appointmentId}`}> |
| 23 | + <img className={s.Image} src={getImageUrl(data.imageUrl)} aria-hidden /> |
| 24 | + |
| 25 | + <div className={s.Wrapper}> |
| 26 | + <div className={s.Heart}> |
| 27 | + <div className={s.Info}> |
| 28 | + <div className={s.Header}> |
| 29 | + <h2 className={s.Title}>{data.title}</h2> |
| 30 | + <div className={s.Price}> |
| 31 | + {data.type === 'RENTAL' && <PriceToken price={data.price} deposit={data.deposit} />} |
| 32 | + {data.type === 'SALE' && <PriceToken price={data.price} />} |
| 33 | + </div> |
| 34 | + |
| 35 | + <div className={s.Tokens}> |
| 36 | + <ItemTokenList |
| 37 | + showCount={3} |
| 38 | + itemInfo={{ |
| 39 | + productTypes: data.productTypes, |
| 40 | + // transactionTypes: data.type, |
| 41 | + // quality: 'BEST', |
| 42 | + // size: 'L', |
| 43 | + // color: 'BLACK', |
| 44 | + // tradeMethods: ['DIRECT'], |
| 45 | + }} |
| 46 | + /> |
| 47 | + </div> |
| 48 | + </div> |
| 49 | + </div> |
| 50 | + </div> |
| 51 | + |
| 52 | + <div className={s.Footer}> |
| 53 | + <Btn |
| 54 | + type="chat" |
| 55 | + appointmentId={data.appointmentId} |
| 56 | + // nickname={data.nickname} |
| 57 | + // chatRoomId={data.chatRoomId} |
| 58 | + /> |
| 59 | + {isSuccess && ( |
| 60 | + <Btn |
| 61 | + type="review" |
| 62 | + appointmentId={data.appointmentId} |
| 63 | + // nickname={data.nickname} |
| 64 | + // isComplete={data.isComplete} |
| 65 | + // chatRoomId={data.chatRoomId} |
| 66 | + /> |
| 67 | + )} |
| 68 | + </div> |
| 69 | + </div> |
| 70 | + </Link> |
| 71 | + <div className={s.Border} /> |
| 72 | + </div> |
| 73 | + ); |
| 74 | +}; |
| 75 | + |
| 76 | +export default PickItemList; |
0 commit comments