|
1 | 1 | import { FormikErrors, FormikValues, FormikHandlers } from "formik"; |
2 | 2 | import { Form, Row, Col, Select, Checkbox, Typography, Card, Divider, Alert, Space } from "antd"; |
3 | 3 | import { useEffect, useState } from "react"; |
4 | | -import { TermsAndConditions } from "@/dummyData/TermsAndConditions"; |
| 4 | +import { FullTime, Intern } from "./TermsAndConditions"; |
5 | 5 | import axios from "axios"; |
6 | 6 | import { API_ENDPOINTS } from "../../utils/jaf.constants"; |
7 | 7 | import { SeasonsDto } from "../../types/jaf.types"; |
@@ -163,49 +163,66 @@ const SeasonDetails = ({ |
163 | 163 | border: '1px solid #e5e7eb' |
164 | 164 | }} |
165 | 165 | > |
166 | | - <div style={{ |
167 | | - marginBottom: 20, |
168 | | - padding: 12, |
169 | | - backgroundColor: '#f9fafb', |
170 | | - borderRadius: 6, |
171 | | - border: '1px solid #e5e7eb' |
172 | | - }}> |
173 | | - <Space direction="vertical" size="small" style={{ width: '100%' }}> |
174 | | - {TermsAndConditions.map((tc, index) => ( |
175 | | - <div |
176 | | - key={index} |
177 | | - style={{ |
178 | | - display: 'flex', |
179 | | - gap: 10, |
180 | | - alignItems: 'flex-start', |
181 | | - padding: '4px 0' |
182 | | - }} |
183 | | - > |
184 | | - <Text |
185 | | - strong |
186 | | - style={{ |
187 | | - color: '#374151', |
188 | | - minWidth: 20, |
189 | | - fontSize: 13, |
190 | | - fontWeight: 600 |
191 | | - }} |
192 | | - > |
193 | | - {index + 1}. |
194 | | - </Text> |
195 | | - <Text |
| 166 | + {selectedSeasonInfo ? ( |
| 167 | + <div style={{ |
| 168 | + marginBottom: 20, |
| 169 | + padding: 12, |
| 170 | + backgroundColor: '#f9fafb', |
| 171 | + borderRadius: 6, |
| 172 | + border: '1px solid #e5e7eb' |
| 173 | + }}> |
| 174 | + |
| 175 | + <Space direction="vertical" size="small" style={{ width: '100%' }}> |
| 176 | + {(selectedSeasonInfo.type.toLowerCase() === 'intern' ? Intern : FullTime).map((tc, index) => ( |
| 177 | + <div |
| 178 | + key={index} |
196 | 179 | style={{ |
197 | | - textAlign: 'justify', |
198 | | - lineHeight: 1.4, |
199 | | - fontSize: 13, |
200 | | - color: '#374151' |
| 180 | + display: 'flex', |
| 181 | + gap: 10, |
| 182 | + alignItems: 'flex-start', |
| 183 | + padding: '4px 0' |
201 | 184 | }} |
202 | 185 | > |
203 | | - {tc} |
204 | | - </Text> |
205 | | - </div> |
206 | | - ))} |
207 | | - </Space> |
208 | | - </div> |
| 186 | + <Text |
| 187 | + strong |
| 188 | + style={{ |
| 189 | + color: '#374151', |
| 190 | + minWidth: 20, |
| 191 | + fontSize: 13, |
| 192 | + fontWeight: 600 |
| 193 | + }} |
| 194 | + > |
| 195 | + {index + 1}. |
| 196 | + </Text> |
| 197 | + <Text |
| 198 | + style={{ |
| 199 | + textAlign: 'justify', |
| 200 | + lineHeight: 1.4, |
| 201 | + fontSize: 13, |
| 202 | + color: '#374151', |
| 203 | + whiteSpace: 'pre-line' |
| 204 | + }} |
| 205 | + > |
| 206 | + {tc} |
| 207 | + </Text> |
| 208 | + </div> |
| 209 | + ))} |
| 210 | + </Space> |
| 211 | + </div> |
| 212 | + ) : ( |
| 213 | + <div style={{ |
| 214 | + marginBottom: 20, |
| 215 | + padding: 24, |
| 216 | + textAlign: 'center', |
| 217 | + backgroundColor: '#f9fafb', |
| 218 | + borderRadius: 6, |
| 219 | + border: '1px solid #e5e7eb' |
| 220 | + }}> |
| 221 | + <Text style={{ color: '#6b7280', fontSize: 14 }}> |
| 222 | + Please select a recruitment season to view the terms and conditions |
| 223 | + </Text> |
| 224 | + </div> |
| 225 | + )} |
209 | 226 |
|
210 | 227 | <Divider style={{ margin: '12px 0' }} /> |
211 | 228 |
|
|
0 commit comments