diff --git a/features/main/components/calendar/organisms/user-calendar-profile.tsx b/features/main/components/calendar/organisms/user-calendar-profile.tsx index d1564cd5..ef68e4d7 100644 --- a/features/main/components/calendar/organisms/user-calendar-profile.tsx +++ b/features/main/components/calendar/organisms/user-calendar-profile.tsx @@ -1,8 +1,11 @@ 'use client'; +import { useAtomValue } from 'jotai'; + import { Image } from '@/components/atoms'; import { useCurrentMemberInfo, useGreetingText } from '@/hooks'; import SwimieCharacterImage from '@/public/images/swimie-character.png'; +import { calendarSwimCountAtom } from '@/store'; import { css, cx } from '@/styled-system/css'; import { flex } from '@/styled-system/patterns'; @@ -11,11 +14,17 @@ import { Calendar } from '../molecules'; export const UserCalendarProfile = () => { const { data, isLoading } = useCurrentMemberInfo(); - const { data: greetingTextData } = useGreetingText(); + const { + data: greetingTextData, + isLoading: isGreetingTextDataLoading, + isSuccess: isGreetingTextDataSuccess, + } = useGreetingText(); + const totalSwimCount = useAtomValue(calendarSwimCountAtom); + const isEmptyCount = totalSwimCount === 0; return ( <> - {isLoading ? ( + {isLoading || isGreetingTextDataLoading ? ( ) : (
@@ -29,7 +38,11 @@ export const UserCalendarProfile = () => {

{data?.data.nickname}님,

- {greetingTextData?.data.message} + {isGreetingTextDataSuccess + ? greetingTextData.data.message + : isEmptyCount + ? '이번달 수영 기록을 해볼까요?' + : `이번달 수영을 ${totalSwimCount}번 다녀왔어요!`}