- ErrorPage 컴포넌트 추가: init/messages 로드 실패(서버/네트워크) 시 ChatContainer 가 에러 화면+재시도(refetch) 렌더 (기존엔 빈 채팅처럼 보임) - 대기 표시: 채팅 영역 '협상 중' 타이핑 버블 + 입력 버튼 자리 '...' 점 애니메이션 - desync 에러코드(CHAT_INPUT_MODE_MISMATCH 1404 / CHAT_AGENT_TIMEOUT 1405) 추가 및 메시지 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
import { Loader2 } from 'lucide-react'
|
|
import { ErrorPage } from '@/components'
|
|
import { useChatController } from '@/features/chat/hooks/useChatController'
|
|
import { ChatSection } from '@/features/chat/components/ChatSection'
|
|
import { MenuSection } from '@/features/chat/components/menu/MenuSection'
|
|
|
|
// 콘텐츠 영역: 채팅 + 우측 메뉴. session_id 로 init/messages 를 적재하고 전송을 주입한다.
|
|
// 진입 로드(init/messages) 상태를 직접 그린다: 로딩 → 스피너, 실패(서버/네트워크) → ErrorPage(재시도).
|
|
export function ChatContainer({ sessionId }: { sessionId: string }) {
|
|
const { isInitLoading, initError, refetchInit } = useChatController(sessionId)
|
|
|
|
if (isInitLoading) {
|
|
return (
|
|
<div className="flex flex-1 items-center justify-center w-full">
|
|
<Loader2 className="size-10 animate-spin text-neutral-50" aria-label="불러오는 중" />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
if (initError) {
|
|
return (
|
|
<div className="flex flex-1 w-full">
|
|
<ErrorPage message="채팅을 불러오는 중 오류가 발생했습니다." onRetry={refetchInit} />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<div className="flex flex-1 min-h-0 w-full">
|
|
<ChatSection />
|
|
<MenuSection />
|
|
</div>
|
|
)
|
|
}
|