diff --git a/src/components/Document/write/EmployerInfoSection.tsx b/src/components/Document/write/EmployerInfoSection.tsx new file mode 100644 index 00000000..50af6d3e --- /dev/null +++ b/src/components/Document/write/EmployerInfoSection.tsx @@ -0,0 +1,92 @@ +import { PartTimeEmployPermitEmployerInfo } from '@/constants/documents'; +import { + EmployerInfoProperty, + EmployerInformation, +} from '@/types/api/document'; +import { Address } from '@/types/api/users'; +import { Map, MapMarker } from 'react-kakao-maps-sdk'; + +const renderMap = (address: Address) => { + return ( + <> +
+
{address.address_name}
+
+
+ + + +
+ + ); +}; + +const EmployerInfoSection = ({ employ }: { employ: EmployerInformation }) => { + return ( +
+
+
+ {Object.entries(employ).map(([key, value]) => ( + <> +
+
+
+
+ { + PartTimeEmployPermitEmployerInfo[ + key as EmployerInfoProperty + ].name + } +
+
+
+ {/* .textfield1 */} + {key !== 'address' && ( +
+
+ {value as string} +
+
+ )} + {key === 'address' && renderMap(value as Address)} +
+ {key === 'address' && ( +
+
+
+
+ Detailed Address +
+
+
+ {/* .textfield1 */} + {key === 'address' && ( +
+
+ {typeof value !== 'string' && value.address_detail as string} +
+
+ )} +
+ )} + + ))} +
+
+
+ ); +}; + +export default EmployerInfoSection;