From 8263c7342774d96863a506e5a58b0395b4b963c2 Mon Sep 17 00:00:00 2001 From: JoeMakuta Date: Mon, 30 Mar 2026 18:00:00 +0200 Subject: [PATCH] refactor: memoize ThreadListItemComponent for performance optimization using memo --- surfsense_web/components/assistant-ui/thread-list.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/surfsense_web/components/assistant-ui/thread-list.tsx b/surfsense_web/components/assistant-ui/thread-list.tsx index db7704470..f1d10ca16 100644 --- a/surfsense_web/components/assistant-ui/thread-list.tsx +++ b/surfsense_web/components/assistant-ui/thread-list.tsx @@ -9,7 +9,7 @@ import { TrashIcon, } from "lucide-react"; import { useRouter } from "next/navigation"; -import { useCallback, useEffect, useState } from "react"; +import { memo, useCallback, useEffect, useState } from "react"; import { Button } from "@/components/ui/button"; import { DropdownMenu, @@ -215,7 +215,7 @@ interface ThreadListItemComponentProps { onDelete: () => void; } -function ThreadListItemComponent({ +const ThreadListItemComponent = memo(function ThreadListItemComponent({ thread, isActive, isArchived, @@ -272,7 +272,7 @@ function ThreadListItemComponent({ ); -} +}); /** * Format a date as relative time (e.g., "2 hours ago", "Yesterday")