mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
🔃 refactor: AgentFooter to conditionally render buttons based on activePanel (#7306)
This commit is contained in:
parent
f6cc394eab
commit
621fa6e1aa
1 changed files with 11 additions and 9 deletions
|
|
@ -50,10 +50,12 @@ export default function AgentFooter({
|
||||||
return localize('com_ui_create');
|
return localize('com_ui_create');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const showButtons = activePanel === Panel.builder;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mx-1 mb-1 flex w-full flex-col gap-2">
|
<div className="mx-1 mb-1 flex w-full flex-col gap-2">
|
||||||
{activePanel !== Panel.advanced && <AdvancedButton setActivePanel={setActivePanel} />}
|
{showButtons && <AdvancedButton setActivePanel={setActivePanel} />}
|
||||||
{user?.role === SystemRoles.ADMIN && <AdminSettings />}
|
{user?.role === SystemRoles.ADMIN && showButtons && <AdminSettings />}
|
||||||
{/* Context Button */}
|
{/* Context Button */}
|
||||||
<div className="flex items-center justify-end gap-2">
|
<div className="flex items-center justify-end gap-2">
|
||||||
<DeleteButton
|
<DeleteButton
|
||||||
|
|
@ -63,13 +65,13 @@ export default function AgentFooter({
|
||||||
/>
|
/>
|
||||||
{(agent?.author === user?.id || user?.role === SystemRoles.ADMIN) &&
|
{(agent?.author === user?.id || user?.role === SystemRoles.ADMIN) &&
|
||||||
hasAccessToShareAgents && (
|
hasAccessToShareAgents && (
|
||||||
<ShareAgent
|
<ShareAgent
|
||||||
agent_id={agent_id}
|
agent_id={agent_id}
|
||||||
agentName={agent?.name ?? ''}
|
agentName={agent?.name ?? ''}
|
||||||
projectIds={agent?.projectIds ?? []}
|
projectIds={agent?.projectIds ?? []}
|
||||||
isCollaborative={agent?.isCollaborative}
|
isCollaborative={agent?.isCollaborative}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{agent && agent.author === user?.id && <DuplicateAgent agent_id={agent_id} />}
|
{agent && agent.author === user?.id && <DuplicateAgent agent_id={agent_id} />}
|
||||||
{/* Submit Button */}
|
{/* Submit Button */}
|
||||||
<button
|
<button
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue