diff --git a/src/components/Document/write/EmployerInfoSection.tsx b/src/components/Document/write/EmployerInfoSection.tsx index 257618a8..6532f754 100644 --- a/src/components/Document/write/EmployerInfoSection.tsx +++ b/src/components/Document/write/EmployerInfoSection.tsx @@ -10,7 +10,6 @@ import { LaborContractEmployerInfoProperty, } from '@/types/api/document'; import { Address } from '@/types/api/users'; -import { Map, MapMarker } from 'react-kakao-maps-sdk'; import { WorkDayTime } from '../../../types/api/document'; import { arrayToString, @@ -19,34 +18,7 @@ import { workDayTimeToString, } from '@/utils/document'; import Tag from '@/components/Common/Tag'; - -// 회사 주소지 지도로 렌더링하는 함수 -const renderMap = (address: Address) => { - return ( - <> -
-
{address.address_name}
-
-
- - - -
- - ); -}; +import { renderMap } from '@/utils/map'; const EmployerInfoSection = ({ employ, diff --git a/src/utils/map.ts b/src/utils/map.ts deleted file mode 100644 index aef5cc87..00000000 --- a/src/utils/map.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * 객체에서 지정된 속성들만 선택하여 새 객체를 반환하는 함수 - * @param obj 원본 객체 - * @param keys 선택할 속성들의 배열 - * @returns 선택된 속성들로 이루어진 새 객체 - */ -export const pick = ( - obj: T, - keys: K[], -): Pick => - keys.reduce( - (result, key) => { - if (key in obj) { - result[key] = obj[key]; - } - return result; - }, - {} as Pick, - ); diff --git a/src/utils/map.tsx b/src/utils/map.tsx new file mode 100644 index 00000000..1dc6de25 --- /dev/null +++ b/src/utils/map.tsx @@ -0,0 +1,52 @@ +import { Address } from '@/types/api/users'; +import { Map, MapMarker } from 'react-kakao-maps-sdk'; + +/** + * 객체에서 지정된 속성들만 선택하여 새 객체를 반환하는 함수 + * @param obj 원본 객체 + * @param keys 선택할 속성들의 배열 + * @returns 선택된 속성들로 이루어진 새 객체 + */ +export const pick = ( + obj: T, + keys: K[], +): Pick => + keys.reduce( + (result, key) => { + if (key in obj) { + result[key] = obj[key]; + } + return result; + }, + {} as Pick, + ); + +// 입력된 주소지 지도로 렌더링하는 함수 +export const renderMap = (address: Address) => { + return ( + <> +
+
+ {address.address_name} +
+
+
+ + + +
+ + ); +};