Skip to content

Commit

Permalink
match voice backend
Browse files Browse the repository at this point in the history
  • Loading branch information
aboutphilippe committed Aug 20, 2024
1 parent 7525d6e commit 9a8c8f4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/components/ChatEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,26 @@ const ChatEvents: React.FC<ChatEventsProps> = ({
<div className="h-full overflow-y-auto p-4">
<ul className="space-y-4">
{events
.filter((event) => ["answer", "question"].includes(event.event))
.filter((event) =>
["userMessage", "roomMessage"].includes(event.event)
)
.map((event, index) => (
<li
key={index}
className={`flex ${
event.event === "answer" ? "justify-start" : "justify-end"
event.event === "roomMessage"
? "justify-start"
: "justify-end"
}`}
>
{event.event === "answer" && (
{event.event === "roomMessage" && (
<div className="flex gap-2 text-left max-w-xs">
<p className="bg-neutral-700 text-white p-4 rounded-xl">
{event.data?.text.replaceAll("•", "")}
</p>
</div>
)}
{event.event === "question" && (
{event.event === "userMessage" && (
<div className="flex gap-2 text-right max-w-xs ml-auto">
<p className="bg-blue-500 text-white p-4 rounded-xl">
{event.data?.text}
Expand Down

0 comments on commit 9a8c8f4

Please sign in to comment.