mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 09:20:15 +01:00
⚡️ refactor: Optimize Rendering Performance for Icons, Conversations (#5234)
* refactor: HoverButtons and Fork components to use explicit props * refactor: improve typing for Fork Component * fix: memoize SpecIcon to avoid unnecessary re-renders * feat: introduce URLIcon component and update SpecIcon for improved icon handling * WIP: optimizing icons * refactor: simplify modelLabel assignment in Message components * refactor: memoize ConvoOptions component to optimize rendering performance
This commit is contained in:
parent
687ab32bd3
commit
0f95604a67
19 changed files with 206 additions and 171 deletions
21
client/src/components/Endpoints/URLIcon.tsx
Normal file
21
client/src/components/Endpoints/URLIcon.tsx
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import React, { memo } from 'react';
|
||||
|
||||
export const URLIcon = memo(
|
||||
({
|
||||
iconURL,
|
||||
altName,
|
||||
containerStyle = { width: '20', height: '20' },
|
||||
imageStyle = { width: '100%', height: '100%' },
|
||||
className = 'icon-xl mr-1 shrink-0 overflow-hidden rounded-full',
|
||||
}: {
|
||||
iconURL: string;
|
||||
altName?: string | null;
|
||||
className?: string;
|
||||
containerStyle?: React.CSSProperties;
|
||||
imageStyle?: React.CSSProperties;
|
||||
}) => (
|
||||
<div className={className} style={containerStyle}>
|
||||
<img src={iconURL} alt={altName ?? ''} style={imageStyle} className="object-cover" />
|
||||
</div>
|
||||
),
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue