diff --git a/frontend/src/apis/chat/chat.type.ts b/frontend/src/apis/chat/chat.type.ts index 3d8fcb7..0455fa5 100644 --- a/frontend/src/apis/chat/chat.type.ts +++ b/frontend/src/apis/chat/chat.type.ts @@ -85,6 +85,7 @@ export function mapMessage(w: ChatMessageWire): ChatMessage { export function mapInit(r: ChatInitResponse): ChatInitData { return { session_id: r.session_id, + session_status: r.session_status, item_id: r.item_id, quotation_id: r.quotation_id, item_name: r.item_name, diff --git a/frontend/src/features/chat/components/ChatMessage.tsx b/frontend/src/features/chat/components/ChatMessage.tsx index 363326b..2888fab 100644 --- a/frontend/src/features/chat/components/ChatMessage.tsx +++ b/frontend/src/features/chat/components/ChatMessage.tsx @@ -1,6 +1,8 @@ import { useEffect, useRef, memo } from 'react' import { cn } from '@/lib' import { useChatStore } from '@/features/chat/stores/useChatStore' +import { useChatInitStore } from '@/features/chat/stores/useChatInitStore' +import { SessionStatus } from '@/apis/negotiation/negotiation.type' import type { ChatMessage as ChatMessageType } from '@/features/chat/types' import { Indicator } from '@/features/chat/components/templates/Indicator' import { Summary } from '@/features/chat/components/templates/Summary' @@ -12,7 +14,7 @@ export function ChatMessage() { return (
{/* pt-[64px]: 첫 메시지를 우측 협상절차 카드 상단과 맞추되, 스크롤 시 여백도 함께 밀려 올라가도록 스크롤 컨테이너 안쪽에 둔다 */} -
+
@@ -91,6 +93,9 @@ const MessageItem = memo(function MessageItem({ }) const BotMessage = memo(function BotMessage({ message, isFirst }: { message: ChatMessageType; isFirst?: boolean }) { + // 인디케이터는 진행 중인 협상에서만 표시 — 완료/거부 등 결과 열람 재진입 시에는 값이 와도 숨긴다 + const sessionStatus = useChatInitStore((s) => s.session_status) + const showIndicator = sessionStatus === SessionStatus.IN_PROGRESS return (
@@ -98,7 +103,7 @@ const BotMessage = memo(function BotMessage({ message, isFirst }: { message: Cha
- {message.bot_chat_type === 'indicator' && message.indicator_value != null && ( + {showIndicator && message.bot_chat_type === 'indicator' && message.indicator_value != null && ( )} {message.bot_chat_type === 'summaryRSP' && message.summary && } diff --git a/frontend/src/features/chat/components/ItemImage.tsx b/frontend/src/features/chat/components/ItemImage.tsx index ff88d06..2d7adb0 100644 --- a/frontend/src/features/chat/components/ItemImage.tsx +++ b/frontend/src/features/chat/components/ItemImage.tsx @@ -27,10 +27,10 @@ export function ItemImage() { function Thumb({ src }: { src: string }) { if (src) { - return 상품 이미지 + return 상품 이미지 } return ( -
+
) diff --git a/frontend/src/features/chat/components/ItemSection.tsx b/frontend/src/features/chat/components/ItemSection.tsx index d9744c8..fc65350 100644 --- a/frontend/src/features/chat/components/ItemSection.tsx +++ b/frontend/src/features/chat/components/ItemSection.tsx @@ -3,6 +3,7 @@ import { createPortal } from 'react-dom' import { cn } from '@/lib' import { ItemImage } from '@/features/chat/components/ItemImage' import { useChatInitStore } from '@/features/chat/stores/useChatInitStore' +import { formatLeadTime } from '@/features/chat/lib/format' export function ItemSection() { return ( @@ -80,7 +81,7 @@ function ItemInfo() {
{title}
displayData !== '-' && showTooltip(e, displayData)} onMouseLeave={hideTooltip} > @@ -100,14 +101,14 @@ function ItemInfo() { {item_name}
-
-
+
+
{renderRow('상품코드', item_code, true)} {renderRow('단가', formattedPrice, true)} {renderRow('모델명', item_model_name, true)} {renderRow('제조사', item_maker_name)} {renderRow('최소주문수량', item_min_order_quantity)} - {renderRow('리드타임', item_lead_time)} + {renderRow('리드타임', formatLeadTime(item_lead_time))}
규격
diff --git a/frontend/src/features/chat/components/UserButton.tsx b/frontend/src/features/chat/components/UserButton.tsx index 480c81a..c2fc1d2 100644 --- a/frontend/src/features/chat/components/UserButton.tsx +++ b/frontend/src/features/chat/components/UserButton.tsx @@ -6,14 +6,15 @@ import { Percent, Price } from '@/features/chat/components/userInputs' import { GO_TO_LIST_TEXT } from '@/features/chat/lib/userButtonConfig' import type { UserButtonConfig } from '@/features/chat/types' +// max-[1180px]: 채팅 폭이 좁아지면 버튼 패딩·최소폭 축소, 상품목록은 아이콘만 남긴다 const style = { goToList: - 'flex w-[159px] h-[48px] bg-neutral-40 hover:brightness-[0.97] rounded-[999px] items-center justify-center title-2 text-neutral-80 cursor-pointer gap-2 transition-all ease-out hover:scale-[1.01]', + 'flex w-[159px] max-[1180px]:w-[48px] h-[48px] bg-neutral-40 hover:brightness-[0.97] rounded-[999px] items-center justify-center title-2 text-neutral-80 cursor-pointer gap-2 max-[1180px]:gap-0 transition-all ease-out hover:scale-[1.01]', black: - 'flex min-w-[120px] px-[32px] h-[48px] bg-primary hover:brightness-[0.97] rounded-[999px] items-center justify-center title-2 text-primary-foreground cursor-pointer whitespace-nowrap transition-all duration-200 ease-out hover:scale-[1.01]', - gray: 'flex min-w-[120px] px-[32px] h-[48px] bg-neutral-60 rounded-[999px] items-center justify-center title-2 text-neutral-00 cursor-pointer whitespace-nowrap transition-all ease-out hover:scale-[1.01]', + 'flex min-w-[120px] px-[32px] max-[1180px]:min-w-[100px] max-[1180px]:px-[20px] h-[48px] bg-primary hover:brightness-[0.97] rounded-[999px] items-center justify-center title-2 text-primary-foreground cursor-pointer whitespace-nowrap transition-all duration-200 ease-out hover:scale-[1.01]', + gray: 'flex min-w-[120px] px-[32px] max-[1180px]:min-w-[100px] max-[1180px]:px-[20px] h-[48px] bg-neutral-60 rounded-[999px] items-center justify-center title-2 text-neutral-00 cursor-pointer whitespace-nowrap transition-all ease-out hover:scale-[1.01]', white: - 'flex min-w-[120px] px-[32px] h-[48px] bg-neutral-00 rounded-[999px] items-center justify-center title-2 text-neutral-80 border border-neutral-80 cursor-pointer whitespace-nowrap transition-all ease-out hover:scale-[1.01]', + 'flex min-w-[120px] px-[32px] max-[1180px]:min-w-[100px] max-[1180px]:px-[20px] h-[48px] bg-neutral-00 rounded-[999px] items-center justify-center title-2 text-neutral-80 border border-neutral-80 cursor-pointer whitespace-nowrap transition-all ease-out hover:scale-[1.01]', } export function UserButton({ type, text, textList, priceErrorMessage }: UserButtonConfig) { @@ -59,9 +60,9 @@ function LoadingDots() { function GoToList() { const navigate = useNavigate() return ( - ) } diff --git a/frontend/src/features/chat/components/menu/MenuSection.tsx b/frontend/src/features/chat/components/menu/MenuSection.tsx index 75c5036..c581635 100644 --- a/frontend/src/features/chat/components/menu/MenuSection.tsx +++ b/frontend/src/features/chat/components/menu/MenuSection.tsx @@ -9,7 +9,7 @@ export function MenuSection() { const [isStepOpen, setIsStepOpen] = useState(true) return ( -
+
diff --git a/frontend/src/features/chat/components/templates/Summary.tsx b/frontend/src/features/chat/components/templates/Summary.tsx index 3901ce6..4d9a366 100644 --- a/frontend/src/features/chat/components/templates/Summary.tsx +++ b/frontend/src/features/chat/components/templates/Summary.tsx @@ -1,4 +1,5 @@ import { numberToKorean } from '@/features/chat/lib/koreanNumber' +import { formatLeadTime } from '@/features/chat/lib/format' import type { ChatSummary } from '@/features/chat/types' // 협상 결과 요약 카드 @@ -26,7 +27,7 @@ export function Summary({ data }: { data: ChatSummary }) { - +
diff --git a/frontend/src/features/chat/components/userInputs.tsx b/frontend/src/features/chat/components/userInputs.tsx index fbefd20..d42c183 100644 --- a/frontend/src/features/chat/components/userInputs.tsx +++ b/frontend/src/features/chat/components/userInputs.tsx @@ -24,7 +24,7 @@ function InputWithUnit({ const errorId = useId() return (
-
+
} sidebar={} header={ - + }