|
| 1 | +import { PRODUCT_TYPES_MAP, type PostInterface } from '@/libs/types/post'; |
| 2 | + |
| 3 | +import * as s from './style.css'; |
| 4 | + |
| 5 | +import Token from '@/common/components/Token'; |
| 6 | + |
| 7 | +interface Props { |
| 8 | + data: PostInterface; |
| 9 | +} |
| 10 | +const PostCard = ({ data }: Props) => { |
| 11 | + return ( |
| 12 | + <div className={s.Container}> |
| 13 | + <img className={s.Image} src={data.thumbnail} aria-hidden /> |
| 14 | + <div className={s.Info}> |
| 15 | + <div className={s.Header}> |
| 16 | + <h2 className={s.Title}>{data.title}</h2> |
| 17 | + <div className={s.Price}> |
| 18 | + <div className={s.PriceItem}> |
| 19 | + <label>λμ¬λ£</label> |
| 20 | + <p>{data.price.toLocaleString()}μ</p> |
| 21 | + </div> |
| 22 | + <div className={s.PriceItem}> |
| 23 | + <label>보μ¦κΈ</label> |
| 24 | + <p>{data.price.toLocaleString()}μ</p> |
| 25 | + </div> |
| 26 | + </div> |
| 27 | + </div> |
| 28 | + <div className={s.Footer}> |
| 29 | + <div className={s.Tokens}> |
| 30 | + {data.productTypes.map((type, index) => ( |
| 31 | + <Token key={`${type}-${index}`}>{PRODUCT_TYPES_MAP[type]}</Token> |
| 32 | + ))} |
| 33 | + </div> |
| 34 | + <div className={s.Interactions}> |
| 35 | + <div className={s.InteractionItem}> |
| 36 | + <span className="mgc_heart_fill" /> |
| 37 | + <p>{data.likeCount}</p> |
| 38 | + </div> |
| 39 | + <div className={s.InteractionItem}> |
| 40 | + <span className="mgc_chat_2_fill" /> |
| 41 | + <p>{data.chatRoomCount}</p> |
| 42 | + </div> |
| 43 | + </div> |
| 44 | + </div> |
| 45 | + </div> |
| 46 | + </div> |
| 47 | + ); |
| 48 | +}; |
| 49 | +export default PostCard; |
0 commit comments