diff --git a/src/components/PostSearch/PostSearchResult.tsx b/src/components/PostSearch/PostSearchResult.tsx index 22dc3aa7..650e8507 100644 --- a/src/components/PostSearch/PostSearchResult.tsx +++ b/src/components/PostSearch/PostSearchResult.tsx @@ -44,17 +44,17 @@ const JOB_POSTING_LIST: JobPostingItemType[] = [ }, ]; -enum SORT_TYPE { - POPULAR = 'Popular', - RECOMMENDED = 'Recommended', - RECENT = 'Recent', -} +const SORT_TYPE = { + POPULAR: 'Popular', + RECOMMENDED: 'Recommended', + RECENT: 'Recent', +} as const; + +type SortType = (typeof SORT_TYPE)[keyof typeof SORT_TYPE]; const PostSearchResult = () => { // TODO: 홈에서 See more 버튼 클릭 시 해당 메뉴로 정렬하기 - const [selectedSort, setSelectedSort] = useState( - SORT_TYPE.POPULAR, - ); + const [selectedSort, setSelectedSort] = useState(SORT_TYPE.POPULAR); return (
@@ -62,7 +62,7 @@ const PostSearchResult = () => { setSelectedSort(sort as SORT_TYPE)} + onSelect={(sort) => setSelectedSort(sort as SortType)} />
{JOB_POSTING_LIST?.length ? (