1- import Image from "next/image" ;
21import { formatRecruitDate , getWorkDaysDisplay } from "@/utils/workDayFormatter" ;
2+ import RecruitConditionItem from "./RecruitConditionItem" ;
33
44interface RecruitConditionProps {
55 hourlyWage : number ;
@@ -11,96 +11,69 @@ interface RecruitConditionProps {
1111 workEndTime : string ;
1212}
1313
14- export const RecruitCondition : React . FC < RecruitConditionProps > = ( {
14+ export const RecruitCondition = ( {
1515 hourlyWage,
1616 recruitmentStartDate,
1717 recruitmentEndDate,
1818 isNegotiableWorkDays,
1919 workDays = [ ] ,
2020 workStartTime,
2121 workEndTime,
22- } ) => {
22+ } : RecruitConditionProps ) => {
23+ const periodValue = (
24+ < >
25+ < span className = "whitespace-normal md:hidden" >
26+ { formatRecruitDate ( recruitmentStartDate ) } ~{ formatRecruitDate ( recruitmentEndDate ) }
27+ </ span >
28+ < span className = "hidden whitespace-normal md:inline" >
29+ { formatRecruitDate ( recruitmentStartDate , true ) } ~
30+ < br />
31+ { formatRecruitDate ( recruitmentEndDate , true ) }
32+ </ span >
33+ </ >
34+ ) ;
35+
36+ const conditions = [
37+ {
38+ icon : {
39+ sm : "/icons/coin/coin-sm.svg" ,
40+ md : "/icons/coin/coin-md.svg" ,
41+ } ,
42+ label : "시급" ,
43+ value : `${ hourlyWage . toLocaleString ( ) } 원` ,
44+ } ,
45+ {
46+ icon : {
47+ sm : "/icons/calendar/calendar-clock-sm.svg" ,
48+ md : "/icons/calendar/calendar-clock-md.svg" ,
49+ } ,
50+ label : "기간" ,
51+ value : periodValue ,
52+ } ,
53+ {
54+ icon : {
55+ sm : "/icons/calendar/calendar-sm.svg" ,
56+ md : "/icons/calendar/calendar-md.svg" ,
57+ } ,
58+ label : "요일" ,
59+ value : getWorkDaysDisplay ( isNegotiableWorkDays , workDays ) ,
60+ } ,
61+ {
62+ icon : {
63+ sm : "/icons/clock/clock-sm.svg" ,
64+ md : "/icons/clock/clock-md.svg" ,
65+ } ,
66+ label : "시간" ,
67+ value : `${ workStartTime } ~${ workEndTime } ` ,
68+ } ,
69+ ] ;
70+
2371 return (
2472 < div className = "h-auto w-full sm:h-[156px] sm:w-[327px] sm:p-3 md:h-[336px] md:w-[640px]" >
2573 < div className = "grid h-full grid-cols-2 gap-2 sm:gap-3" >
26- { /* 시급 섹션 */ }
27- < div className = "flex items-center gap-2 overflow-hidden rounded-lg border border-gray-200 p-1 sm:p-3 md:gap-6 md:p-6" >
28- < div className = "flex h-6 w-6 items-center justify-center rounded-full bg-gray-100 bg-opacity-30 sm:h-9 sm:w-9 md:h-16 md:w-16" >
29- < div className = "block md:hidden" >
30- < Image src = "/icons/coin/coin-sm.svg" alt = "coin" width = { 24 } height = { 24 } />
31- </ div >
32- < div className = "hidden md:block" >
33- < Image src = "/icons/coin/coin-md.svg" alt = "coin" width = { 36 } height = { 36 } />
34- </ div >
35- </ div >
36- < div className = "flex-1" >
37- < div className = "text-[10px] font-medium text-gray-600 sm:text-xs md:text-xl" > 시급</ div >
38- < div className = "text-xs font-semibold text-primary-orange-300 sm:text-sm md:text-2xl" >
39- { hourlyWage . toLocaleString ( ) } 원
40- </ div >
41- </ div >
42- </ div >
43-
44- { /* 기간 섹션 */ }
45- < div className = "flex items-center gap-2 overflow-hidden rounded-lg border border-gray-200 p-1 sm:p-3 md:gap-6 md:p-6" >
46- < div className = "flex h-6 w-6 items-center justify-center rounded-full bg-gray-100 bg-opacity-30 sm:h-9 sm:w-9 md:h-16 md:w-16" >
47- < div className = "block md:hidden" >
48- < Image src = "/icons/calendar/calendar-clock-sm.svg" alt = "calendar" width = { 24 } height = { 24 } />
49- </ div >
50- < div className = "hidden md:block" >
51- < Image src = "/icons/calendar/calendar-clock-md.svg" alt = "calendar" width = { 36 } height = { 36 } />
52- </ div >
53- </ div >
54- < div className = "flex-1" >
55- < div className = "text-[10px] font-medium text-gray-600 sm:text-xs md:text-xl" > 기간</ div >
56- < div className = "break-words text-xs font-semibold text-primary-orange-300 sm:text-sm md:text-2xl" >
57- < span className = "whitespace-normal md:hidden" >
58- { formatRecruitDate ( recruitmentStartDate ) } ~{ formatRecruitDate ( recruitmentEndDate ) }
59- </ span >
60- < span className = "hidden whitespace-normal md:inline" >
61- { formatRecruitDate ( recruitmentStartDate , true ) } ~
62- < br />
63- { formatRecruitDate ( recruitmentEndDate , true ) }
64- </ span >
65- </ div >
66- </ div >
67- </ div >
68-
69- { /* 요일 섹션 */ }
70- < div className = "flex items-center gap-2 overflow-hidden rounded-lg border border-gray-200 p-1 sm:p-3 md:gap-6 md:p-6" >
71- < div className = "flex h-6 w-6 items-center justify-center rounded-full bg-gray-100 bg-opacity-30 sm:h-9 sm:w-9 md:h-16 md:w-16" >
72- < div className = "block md:hidden" >
73- < Image src = "/icons/calendar/calendar-sm.svg" alt = "calendar" width = { 24 } height = { 24 } />
74- </ div >
75- < div className = "hidden md:block" >
76- < Image src = "/icons/calendar/calendar-md.svg" alt = "calendar" width = { 36 } height = { 36 } />
77- </ div >
78- </ div >
79- < div className = "flex-1" >
80- < div className = "text-[10px] font-medium text-gray-600 sm:text-xs md:text-xl" > 요일</ div >
81- < div className = "text-xs font-semibold text-primary-orange-300 sm:text-sm md:text-2xl" >
82- { getWorkDaysDisplay ( isNegotiableWorkDays , workDays ) }
83- </ div >
84- </ div >
85- </ div >
86-
87- { /* 시간 섹션 */ }
88- < div className = "flex items-center gap-2 overflow-hidden rounded-lg border border-gray-200 p-1 sm:p-3 md:gap-6 md:p-6" >
89- < div className = "flex h-6 w-6 items-center justify-center rounded-full bg-gray-100 bg-opacity-30 sm:h-9 sm:w-9 md:h-16 md:w-16" >
90- < div className = "block md:hidden" >
91- < Image src = "/icons/clock/clock-sm.svg" alt = "clock" width = { 24 } height = { 24 } />
92- </ div >
93- < div className = "hidden md:block" >
94- < Image src = "/icons/clock/clock-md.svg" alt = "clock" width = { 36 } height = { 36 } />
95- </ div >
96- </ div >
97- < div className = "flex-1" >
98- < div className = "text-[10px] font-medium text-gray-600 sm:text-xs md:text-xl" > 시간</ div >
99- < div className = "text-xs font-semibold text-primary-orange-300 sm:text-sm md:text-2xl" >
100- { workStartTime } ~{ workEndTime }
101- </ div >
102- </ div >
103- </ div >
74+ { conditions . map ( ( condition , index ) => (
75+ < RecruitConditionItem key = { index } icon = { condition . icon } label = { condition . label } value = { condition . value } />
76+ ) ) }
10477 </ div >
10578 </ div >
10679 ) ;
0 commit comments