diff --git a/src/components/projects/ProjectLiveAgent.tsx b/src/components/projects/ProjectLiveAgent.tsx
index ec469c3..f4f41af 100644
--- a/src/components/projects/ProjectLiveAgent.tsx
+++ b/src/components/projects/ProjectLiveAgent.tsx
@@ -30,6 +30,35 @@ interface LiveStreamStatusPayload {
error?: string | null;
}
+function StreamingAgentBubble({ content }: { content: string }) {
+ return (
+
+
+ agent
+
+
{content || "Réponse en cours..."}
+
+
+
+
+
+
+ Génération en cours
+
+
+ );
+}
+
export default function ProjectLiveAgent() {
const { projectId } = useParams<{ projectId: string }>();
const [agents, setAgents] = useState([]);
@@ -128,7 +157,7 @@ export default function ProjectLiveAgent() {
return next;
});
- if (payload.message.sender === "agent") {
+ if (payload.message.sender === "agent" && payload.message.content.trim() !== "") {
setStreamingAgentResponse(null);
}
}),
@@ -338,14 +367,7 @@ export default function ProjectLiveAgent() {
))}
{streamingAgentResponse !== null && (
-
-
- agent
-
-
- {streamingAgentResponse || "En train de repondre..."}
-
-
+
)}
{messages.length === 0 && streamingAgentResponse === null && (
Pas encore de message.