Skip to content

Commit

Permalink
show selected conversation
Browse files Browse the repository at this point in the history
  • Loading branch information
tdraier committed Nov 26, 2024
1 parent 9ba5c84 commit 469dc7c
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from "@dust-tt/sparkle";
import { useConversations } from "@extension/components/conversation/useConversations";
import moment from "moment";
import { useNavigate } from "react-router-dom";
import { useNavigate, useParams } from "react-router-dom";

type GroupLabel =
| "Today"
Expand All @@ -24,6 +24,8 @@ type GroupLabel =

const Content = () => {
const { conversations, isConversationsLoading } = useConversations();
const { conversationId } = useParams();

const navigate = useNavigate();

const groupConversationsByDate = (
Expand Down Expand Up @@ -89,6 +91,11 @@ const Content = () => {
<DropdownMenuItem
key={conversation.sId}
label={conversation.title || "Untitled Conversation"}
className={
conversationId === conversation.sId
? "bg-primary-50"
: undefined
}
onClick={() => {
navigate(`/conversations/${conversation.sId}`);
}}
Expand Down

0 comments on commit 469dc7c

Please sign in to comment.