-
+
+ {messages.map(({ id, message, sender }) =>
+ sender === 'user' ? (
+
+ ) : (
+
+ )
+ )}
- {messages.map((msg, i) => (
-
- ))}
+
+ {showNewMessageAlert &&
}
diff --git a/src/domains/recommend/components/BotCocktailCard.tsx b/src/domains/recommend/components/bot/BotCocktailCard.tsx
similarity index 100%
rename from src/domains/recommend/components/BotCocktailCard.tsx
rename to src/domains/recommend/components/bot/BotCocktailCard.tsx
diff --git a/src/domains/recommend/components/BotMessage.tsx b/src/domains/recommend/components/bot/BotMessage.tsx
similarity index 78%
rename from src/domains/recommend/components/BotMessage.tsx
rename to src/domains/recommend/components/bot/BotMessage.tsx
index d9bb2b8..b3f7655 100644
--- a/src/domains/recommend/components/BotMessage.tsx
+++ b/src/domains/recommend/components/bot/BotMessage.tsx
@@ -8,38 +8,26 @@ import BotOptions from './BotOptions';
import TypingIndicator from './TypingIndicator';
interface Message {
- id: string;
- text?: string;
+ id: number;
+ message?: string;
type?: 'radio' | 'text' | 'recommend';
}
-function BotMessage() {
+interface BotMessages {
+ messages: Message[];
+ isTyping?: boolean;
+}
+
+function BotMessage({ messages, isTyping = false }: BotMessages) {
const [selected, setSelected] = useState('option1');
- // radio 옵션
+ // 임시 radio 옵션
const options = [
{ label: '옵션 1', value: 'option1' },
{ label: '옵션 2', value: 'option2' },
{ label: '옵션 3', value: 'option3' },
];
- // 메시지 (연속 메시지)
- const messages: Message[] = [
- {
- id: '1',
- text: '안녕하세요, 바텐더 쑤리에요. \n 취향에 맞는 칵테일을 추천해드릴게요!',
- },
- {
- id: '2',
- text: '어떤 유형으로 찾아드릴까요?',
- type: 'radio',
- },
- {
- id: '3',
- type: 'recommend',
- },
- ];
-
return (
);
diff --git a/src/domains/recommend/components/BotOptions.tsx b/src/domains/recommend/components/bot/BotOptions.tsx
similarity index 100%
rename from src/domains/recommend/components/BotOptions.tsx
rename to src/domains/recommend/components/bot/BotOptions.tsx
diff --git a/src/domains/recommend/components/bot/NewMessageAlert.tsx b/src/domains/recommend/components/bot/NewMessageAlert.tsx
new file mode 100644
index 0000000..7b49008
--- /dev/null
+++ b/src/domains/recommend/components/bot/NewMessageAlert.tsx
@@ -0,0 +1,23 @@
+'use client';
+import Down from '@/shared/assets/icons/selectDown_24.svg';
+
+interface Props {
+ onClick: () => void;
+}
+
+function NewMessageAlert({ onClick }: Props) {
+ return (
+