|
| 1 | +import { Suspense } from 'react'; |
| 2 | + |
| 3 | +import { |
| 4 | + postContainerLayout, |
| 5 | + postContainerTitleDesktop, |
| 6 | + horizontalLineMobile, |
| 7 | + filterWrapper, |
| 8 | + totalPostCountWrapper, |
| 9 | + postListWrapper, |
| 10 | +} from './ExperimentContentSection.css'; |
| 11 | +import ExperimentPostSection from '../ExperimentPostSection/ExperimentPostSection'; |
| 12 | +import ExperimentPostTotalCount from '../ExperimentPostTotalCount/ExperimentPostTotalCount'; |
| 13 | +import FilterSection from '../FilterSection/FilterSection'; |
| 14 | +import RecruitStatusCheckbox from '../RecruitStatusCheckbox/RecruitStatusCheckbox'; |
| 15 | + |
| 16 | +import { ExperimentPostListFilters } from '@/apis/post'; |
| 17 | +import FilterSkeleton from '@/components/Skeleton/FilterSkeleton/FilterSkeleton'; |
| 18 | +import PostListSkeleton from '@/components/Skeleton/PostListSkeleton/PostListSkeleton'; |
| 19 | +import TotalCountSkeleton from '@/components/Skeleton/TotalCountSkeleton/TotalCountSkeleton'; |
| 20 | + |
| 21 | +interface ExperimentContentSectionProps { |
| 22 | + searchParams: { |
| 23 | + [k in keyof ExperimentPostListFilters]?: string; |
| 24 | + }; |
| 25 | +} |
| 26 | + |
| 27 | +const ExperimentContentSection = ({ searchParams }: ExperimentContentSectionProps) => { |
| 28 | + return ( |
| 29 | + <section className={postContainerLayout}> |
| 30 | + <h2 className={postContainerTitleDesktop}>공고를 확인해 보세요</h2> |
| 31 | + <div className={horizontalLineMobile} /> |
| 32 | + |
| 33 | + {/* 필터링 */} |
| 34 | + <div className={filterWrapper}> |
| 35 | + <Suspense fallback={<FilterSkeleton />}> |
| 36 | + <FilterSection searchParams={searchParams} /> |
| 37 | + </Suspense> |
| 38 | + </div> |
| 39 | + |
| 40 | + {/* 모집 중인 공고만 보기 */} |
| 41 | + <RecruitStatusCheckbox /> |
| 42 | + |
| 43 | + {/* 총 공고 개수 */} |
| 44 | + <div className={totalPostCountWrapper}> |
| 45 | + <Suspense fallback={<TotalCountSkeleton />}> |
| 46 | + <ExperimentPostTotalCount searchParams={searchParams} /> |
| 47 | + </Suspense> |
| 48 | + </div> |
| 49 | + |
| 50 | + {/* 공고 목록 */} |
| 51 | + <div className={postListWrapper}> |
| 52 | + <Suspense fallback={<PostListSkeleton />}> |
| 53 | + <ExperimentPostSection searchParams={searchParams} /> |
| 54 | + </Suspense> |
| 55 | + </div> |
| 56 | + </section> |
| 57 | + ); |
| 58 | +}; |
| 59 | + |
| 60 | +export default ExperimentContentSection; |
0 commit comments