1+ import { recruitmentStatusMap } from '@/contants/stateToLabelMaps'
12import { TeamRecruitmentListItem } from '@/types/api/Team.types'
3+ import clsx from 'clsx'
24
35import { Chip } from '@/components/common/chip'
46import { Divider } from '@/components/common/divider'
@@ -24,7 +26,7 @@ export const TeamRecruitmentCard = ({
2426 createdAt,
2527 } = teamRecruitmentItem
2628 const { nickname, imageUrl } = writer
27- const activeRecruitmentLabel = teamIsActive ? '모집 중' : '모집 완료'
29+ const activeRecruitmentLabel = recruitmentStatusMap [ ` ${ teamIsActive } ` ]
2830 const recruitmentNumLabel = `모집인원 : ${ 1 } /${ teamRecruitmentNum } `
2931 const teckStackLabel = ( teamTechStack ?? [ ] )
3032 . map ( stack => `#${ stack } ` )
@@ -39,21 +41,9 @@ export const TeamRecruitmentCard = ({
3941 < Card . Title > { teamTitle } </ Card . Title >
4042 </ div >
4143 < div className = 'flex items-center gap-10' >
42- < Text . Body variant = 'body1' color = 'gray700' className = 'shrink-0' >
43- { teamPosition }
44- </ Text . Body >
45- < Divider />
46- < Text . Body variant = 'body1' color = 'gray700' className = 'shrink-0' >
47- { recruitmentNumLabel }
48- </ Text . Body >
49- < Divider />
50- < Text . Body
51- variant = 'body1'
52- color = 'gray700'
53- className = 'shrink overflow-x-hidden overflow-ellipsis'
54- >
55- { teckStackLabel }
56- </ Text . Body >
44+ < ItemWithDivider label = { teamPosition } />
45+ < ItemWithDivider label = { recruitmentNumLabel } />
46+ < ItemWithDivider label = { teckStackLabel } isLast />
5747 </ div >
5848 < div className = 'my-12 flex items-center gap-8' >
5949 < Card . Wrtier nickname = { nickname } imageUrl = { imageUrl } />
@@ -66,3 +56,29 @@ export const TeamRecruitmentCard = ({
6656 </ Card >
6757 )
6858}
59+
60+ interface ItemWithDividerProps {
61+ label : string
62+ isLast ?: boolean
63+ }
64+
65+ const ItemWithDivider = ( {
66+ label,
67+ isLast,
68+ } : ItemWithDividerProps ) : JSX . Element => (
69+ < >
70+ < Text . Body
71+ variant = 'body1'
72+ color = 'gray700'
73+ className = { clsx (
74+ { 'shrink-0' : ! isLast } ,
75+ {
76+ 'shrink overflow-x-hidden overflow-ellipsis' : isLast ,
77+ }
78+ ) }
79+ >
80+ { label }
81+ </ Text . Body >
82+ { ! isLast && < Divider /> }
83+ </ >
84+ )
0 commit comments