From 9e6cc2b07f635d7df316947de13b1f6537c8f911 Mon Sep 17 00:00:00 2001 From: Mikyo King Date: Fri, 20 Dec 2024 15:40:33 -0700 Subject: [PATCH] cleanup --- app/src/hooks/useChatMessageStyles.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/hooks/useChatMessageStyles.ts b/app/src/hooks/useChatMessageStyles.ts index 15be1018b3..89d8495f92 100644 --- a/app/src/hooks/useChatMessageStyles.ts +++ b/app/src/hooks/useChatMessageStyles.ts @@ -6,23 +6,23 @@ export function useChatMessageStyles( role: string ): Pick { return useMemo(() => { - role = role.toLowerCase(); - if (role === "user" || role === "human") { + const normalizedRole = role.toLowerCase(); + if (normalizedRole === "user" || normalizedRole === "human") { return { backgroundColor: "grey-100", borderColor: "grey-500", }; - } else if (role === "assistant" || role === "ai") { + } else if (normalizedRole === "assistant" || normalizedRole === "ai") { return { backgroundColor: "blue-100", borderColor: "blue-700", }; - } else if (role === "system") { + } else if (normalizedRole === "system" || normalizedRole === "developer") { return { backgroundColor: "indigo-100", borderColor: "indigo-700", }; - } else if (["function", "tool"].includes(role)) { + } else if (["function", "tool"].includes(normalizedRole)) { return { backgroundColor: "yellow-100", borderColor: "yellow-700",