From 98c5ffbaf2df598f24387e5ae32fed94f46677d8 Mon Sep 17 00:00:00 2001 From: Jiseung Date: Wed, 22 Nov 2023 20:37:24 +0900 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=ED=98=95=EC=8B=9D=20?= =?UTF-8?q?=EA=B2=B0=EC=A0=95=20=EB=A1=9C=EC=A7=81=EC=9D=84=20=EA=B0=9D?= =?UTF-8?q?=EC=B2=B4=20=ED=98=95=ED=83=9C=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MogacoDetail/DetailHeaderButtons.tsx | 60 +++++++++---------- 1 file changed, 27 insertions(+), 33 deletions(-) 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 '모집 중' | '마감' | '종료'] : ''; }