diff --git a/src/app/schedule/(components)/empty-state.tsx b/src/app/schedule/(components)/empty-state.tsx deleted file mode 100644 index b9a80a52..00000000 --- a/src/app/schedule/(components)/empty-state.tsx +++ /dev/null @@ -1,51 +0,0 @@ -'use client'; - -import { Icon } from '@/components/icon'; -import { Button } from '@/components/ui'; -import { cn } from '@/lib/utils'; - -type EmptyStateProps = { - type: 'current' | 'myPost' | 'past'; - onButtonClick: () => void; -}; - -const EMPTY_STATE_CONFIG = { - current: { - text: '현재 참여 중인 모임이 없어요.\n지금 바로 모임을 참여해보세요!', - buttonText: '모임 보러가기', - buttonWidth: 'w-[124px]', - }, - myPost: { - text: '아직 생성한 모임이 없어요.\n지금 바로 모임을 만들어보세요!', - buttonText: '모임 만들기', - buttonWidth: 'w-[112px]', - }, - past: { - text: '아직 참여한 모임이 없어요.\n마음에 드는 모임을 발견해보세요!', - buttonText: '모임 보러가기', - buttonWidth: 'w-[124px]', - }, -} as const; - -export const EmptyState = ({ type, onButtonClick }: EmptyStateProps) => { - const config = EMPTY_STATE_CONFIG[type]; - - return ( -
-
- ); -}; diff --git a/src/app/schedule/(components)/meeting-list.tsx b/src/app/schedule/(components)/meeting-list.tsx index 1fcf668c..44b716ec 100644 --- a/src/app/schedule/(components)/meeting-list.tsx +++ b/src/app/schedule/(components)/meeting-list.tsx @@ -4,15 +4,51 @@ import { useRouter } from 'next/navigation'; import { RefObject } from 'react'; +import { EmptyState } from '@/components/layout/empty-state'; import { ErrorMessage } from '@/components/shared'; import Card from '@/components/shared/card'; +import { Button } from '@/components/ui'; import { formatDateTime } from '@/lib/formatDateTime'; import { GroupListItemResponse } from '@/types/service/group'; -import { EmptyState } from './empty-state'; - type TabType = 'current' | 'myPost' | 'past'; +const EMPTY_STATE_CONFIG = { + current: { + text: ( + <> + 현재 참여 중인 모임이 없어요. +
+ 지금 바로 모임을 참여해보세요! + + ), + buttonText: '모임 보러가기', + buttonWidth: 'w-31', + }, + myPost: { + text: ( + <> + 아직 생성한 모임이 없어요. +
+ 지금 바로 모임을 만들어보세요! + + ), + buttonText: '모임 만들기', + buttonWidth: 'w-31', + }, + past: { + text: ( + <> + 아직 참여한 모임이 없어요. +
+ 마음에 드는 모임을 발견해보세요! + + ), + buttonText: '모임 보러가기', + buttonWidth: 'w-31', + }, +} as const; + type MeetingListProps = { meetings: GroupListItemResponse[]; tabType: TabType; @@ -41,7 +77,19 @@ export const MeetingList = ({ const router = useRouter(); if (meetings.length === 0 && !error) { - return router.push(emptyStatePath)} />; + const config = EMPTY_STATE_CONFIG[emptyStateType]; + return ( +
+ {config.text} + + +
+ ); } return (