diff --git a/src/components/molecules/chat/ChatHeaderInfo.tsx b/src/components/molecules/chat/ChatHeaderInfo.tsx index 07b6644..f2d4531 100644 --- a/src/components/molecules/chat/ChatHeaderInfo.tsx +++ b/src/components/molecules/chat/ChatHeaderInfo.tsx @@ -3,6 +3,7 @@ import Title from '@/components/atoms/Title'; import ToggleButton from '@/components/molecules/ToggleButton'; import SearchMessage from '@/components/organisms/chat/SearchMessage'; import { useChannel } from '@/hooks/chat/useChannel'; +import useAuthStore from '@/store/authStore'; import { useChatStore } from '@/store/chatStore'; import { Channel } from '@/types/channel.type'; import { useEffect, useState } from 'react'; @@ -13,6 +14,11 @@ interface ChatHeaderInfoProps { } const ChannelInfo = ({ channel }: { channel: Channel }) => { + const currentUserId = useAuthStore((state) => state.userInfo.userId); + const channelTitle = + channel.type === 'private' + ? channel.users.find((user) => user.userId !== currentUserId)?.name + : channel.title; return (