@@ -2,36 +2,40 @@ import { Link } from 'react-router';
22
33import * as s from './style.css' ;
44
5- import { PRODUCT_TYPES_MAP } from '@/libs/types/item' ;
65import type { ItemInterface } from '@/features/home/types' ;
7- import Token from '@/common/components/Token' ;
6+ import ItemTokenList from '@/common/components/ItemTokenList' ;
7+ import PriceToken from '@/features/home/components/ItemCard/PriceToken' ;
88
99interface Props {
1010 data : ItemInterface ;
1111}
1212const ItemCard = ( { data } : Props ) => {
13+ const isRental = data . transactionTypes . includes ( 'RENTAL' ) ;
14+ const isSale = data . transactionTypes . includes ( 'SALE' ) ;
15+
1316 return (
1417 < Link className = { s . Container } to = { `/detail/${ data . itemId } ` } >
1518 < img className = { s . Image } src = { data . thumbnail } aria-hidden />
1619 < div className = { s . Info } >
1720 < div className = { s . Header } >
1821 < h2 className = { s . Title } > { data . title } </ h2 >
1922 < div className = { s . Price } >
20- < div className = { s . PriceItem } >
21- < label > λμ¬λ£</ label >
22- < p > { data . rentalFee . toLocaleString ( ) } μ</ p >
23- </ div >
24- < div className = { s . PriceItem } >
25- < label > 보μ¦κΈ</ label >
26- < p > { data . deposit . toLocaleString ( ) } μ</ p >
27- </ div >
23+ { isRental && < PriceToken price = { data . rentalFee } deposit = { data . deposit } /> }
24+ { isSale && < PriceToken price = { data . salePrice } /> }
2825 </ div >
2926 </ div >
3027 < div className = { s . Footer } >
3128 < div className = { s . Tokens } >
32- { data . productTypes . map ( ( type , index ) => (
33- < Token key = { `${ type } -${ index } ` } > { PRODUCT_TYPES_MAP [ type ] } </ Token >
34- ) ) }
29+ { /* TODO: API μμ μμ² */ }
30+ < ItemTokenList
31+ showAll = { false }
32+ itemInfo = { {
33+ productTypes : data . productTypes ,
34+ quality : 'BEST' ,
35+ size : 'L' ,
36+ tradeMethods : [ 'DIRECT' ] ,
37+ } }
38+ />
3539 </ div >
3640 < div className = { s . Interactions } >
3741 < div className = { s . InteractionItem } >
0 commit comments