mirror of
https://github.com/stablyai/orca.git
synced 2026-10-25 08:04:05 +00:00
fix(settings): call getAgentLabel once per agent
Keeps the pane-agent-identity ratchet at two occurrences and avoids a duplicate lookup for the tooltip label.
This commit is contained in:
@@ -14,18 +14,21 @@ export function NativeChatSupportedAgents(): React.JSX.Element {
|
||||
'Supported agents:'
|
||||
)}
|
||||
</span>
|
||||
{NATIVE_CHAT_SUPPORTED_AGENT_LIST.map((agent) => (
|
||||
<Tooltip key={agent}>
|
||||
<TooltipTrigger asChild>
|
||||
<span data-agent={agent} aria-label={getAgentLabel(agent)}>
|
||||
<AgentIcon agent={agent} size={13} />
|
||||
</span>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="top" sideOffset={6}>
|
||||
{getAgentLabel(agent)}
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
))}
|
||||
{NATIVE_CHAT_SUPPORTED_AGENT_LIST.map((agent) => {
|
||||
const label = getAgentLabel(agent)
|
||||
return (
|
||||
<Tooltip key={agent}>
|
||||
<TooltipTrigger asChild>
|
||||
<span data-agent={agent} aria-label={label}>
|
||||
<AgentIcon agent={agent} size={13} />
|
||||
</span>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="top" sideOffset={6}>
|
||||
{label}
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</TooltipProvider>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user