fix(CQ-WEB-8): Add React.memo to performance-sensitive components
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Wrap 7 list-item/card components with React.memo to prevent unnecessary re-renders when parent components update but props remain unchanged: - TaskItem (task lists) - EventCard (calendar views) - EntryCard (knowledge base) - WorkspaceCard (workspace list) - TeamCard (team list) - DomainItem (domain list) - ConnectionCard (federation connections) All are pure components rendered inside .map() loops that depend solely on their props for rendering output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
* Displays a single federation connection with PDA-friendly design
|
||||
*/
|
||||
|
||||
import React from "react";
|
||||
import { FederationConnectionStatus, type ConnectionDetails } from "@/lib/api/federation";
|
||||
|
||||
interface ConnectionCardProps {
|
||||
@@ -50,7 +51,7 @@ function getStatusDisplay(status: FederationConnectionStatus): {
|
||||
}
|
||||
}
|
||||
|
||||
export function ConnectionCard({
|
||||
export const ConnectionCard = React.memo(function ConnectionCard({
|
||||
connection,
|
||||
onAccept,
|
||||
onReject,
|
||||
@@ -149,4 +150,4 @@ export function ConnectionCard({
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user