From 3e1145f1585fb57b0911c2ca847d07fe6e8447f4 Mon Sep 17 00:00:00 2001 From: Colin Spence Date: Thu, 21 Dec 2023 00:00:50 -0700 Subject: [PATCH] WIP: Styles for goal status - hardcoded goalAchieved key added to chat in return --- apps/browser/components/Sidebar.tsx | 140 +++++++++++++++------------- 1 file changed, 77 insertions(+), 63 deletions(-) diff --git a/apps/browser/components/Sidebar.tsx b/apps/browser/components/Sidebar.tsx index abaecc68..78391cc4 100644 --- a/apps/browser/components/Sidebar.tsx +++ b/apps/browser/components/Sidebar.tsx @@ -20,6 +20,8 @@ import { NotePencil, PencilSimple, TrashSimple, + CheckCircle, + XCircle, } from "@phosphor-icons/react"; import { useRouter } from "next/navigation"; import { useSession } from "next-auth/react"; @@ -108,7 +110,7 @@ const Sidebar = ({ if (activeChat !== chatId) { setActiveChat(chatId); } - }, [chatId, activeChat]) + }, [chatId, activeChat]); useEffect(() => { function handleClickOutside(event: MouseEvent) { @@ -183,74 +185,86 @@ const Sidebar = ({ {!isLoadingChats ? (
{chats && chats.length > 0 ? ( -
- {mappedChats?.map((chat) => ( -
handleChatClick(chat.id)} - > - {chat.id === editChat?.id ? ( -
- { - if (e.key === "Enter") { - await handleEditClick( - chat.id, - e.currentTarget.value - ) - } - }} - /> -
- ) : ( - chat.name - )} +
+ {mappedChats?.map((chat) => { + chat.goalAchieved = Math.random() > 0.5; + return (
handleChatClick(chat.id)} > - - + + +
-
- ))} + ); + })}
) : (