diff --git a/app/frontend/src/components/MogacoDetail/DetailHeaderButtons.tsx b/app/frontend/src/components/MogacoDetail/DetailHeaderButtons.tsx index e64e44564..88e3f25be 100644 --- a/app/frontend/src/components/MogacoDetail/DetailHeaderButtons.tsx +++ b/app/frontend/src/components/MogacoDetail/DetailHeaderButtons.tsx @@ -4,40 +4,34 @@ type DetailHeaderButtonsProps = { status: string; }; -export function DetailHeaderButtons({ status }: DetailHeaderButtonsProps) { - if (status === '모집 중') { - return ( +const buttonComponents = { + '모집 중': ( + + ), + 마감: ( + <> - ); - } - - if (status === '마감') { - return ( - <> - - - - ); - } - - if (status === '종료') { - return ( - <> - - - - ); - } + + + ), + 종료: ( + <> + + + + ), +}; - return null; +export function DetailHeaderButtons({ status }: DetailHeaderButtonsProps) { + return status ? buttonComponents[status as '모집 중' | '마감' | '종료'] : ''; }