import React from 'react';
const ChatMessage = ({ type, content, products, clarification, debug }) => {
return (
{type === 'user' &&
👤 شما:
}
{type === 'bot' &&
🤖 پاسخ:
}
{type === 'text' &&
{content}
}
{type === 'product_list' && (
نتیجه: {content}
تعداد: {products?.length || 0}
{products?.map((product, index) => (
{product.name}
قیمت: {product.formatted_price} تومان
وضعیت: {product.stock ? '✅ موجود' : '❌ ناموجود'}
برند: {product.brand || '-'} | شهر: {product.city || '-'}
))}
)}
{clarification && (
❗ ابهام تشخیص داده شد: {clarification}
)}
{debug && (
🧪 فیلترهای استخراجشده توسط LLM (JSON)
{JSON.stringify(debug, null, 2)}
)}
);
};
export default ChatMessage;