From e0ecea61f8ca9d5237621a95167222b7b0e46347 Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Mon, 18 May 2026 21:40:23 +0530 Subject: [PATCH] refactor: extract user avatar color and initials logic into a new utility module, update related components to use the new functions --- .../components/ApiKeyContent.tsx | 12 +++-- .../components/ProfileContent.tsx | 31 ++++++++----- .../assistant-ui/assistant-message.tsx | 4 +- .../layout/ui/sidebar/SidebarUserProfile.tsx | 45 ++----------------- .../settings/user-settings-panel.tsx | 2 +- surfsense_web/lib/user-avatar.ts | 34 ++++++++++++++ 6 files changed, 65 insertions(+), 63 deletions(-) create mode 100644 surfsense_web/lib/user-avatar.ts diff --git a/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/ApiKeyContent.tsx b/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/ApiKeyContent.tsx index 4ee8bad1c..74d8ab140 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/ApiKeyContent.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/ApiKeyContent.tsx @@ -27,14 +27,12 @@ export function ApiKeyContent() { return (
{t("usage_description")}