mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-28 10:26:33 +02:00
refactor: memoize ThreadListItemComponent for performance optimization using memo
This commit is contained in:
parent
e0cd8932da
commit
8263c73427
1 changed files with 3 additions and 3 deletions
|
|
@ -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({
|
|||
</DropdownMenu>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Format a date as relative time (e.g., "2 hours ago", "Yesterday")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue