1
- import { CaretDown , CaretUp , Plus } from "@phosphor-icons/react" ;
1
+ import { CaretDown , CaretUp , Plus , CaretLeft } from "@phosphor-icons/react" ;
2
2
import AnythingInfinityLogo from "@/media/logo/anything-llm-infinity.png" ;
3
3
import { useState , useRef , useEffect } from "react" ;
4
4
import { useNavigate , useParams } from "react-router-dom" ;
@@ -32,72 +32,83 @@ export default function HeaderMenu({
32
32
} , [ ] ) ;
33
33
34
34
return (
35
- < div className = "absolute top-4 left-4 right-4" >
36
- < div className = "flex justify-between items-center max-w-[1700px] mx-auto" >
37
- < div
38
- className = "flex items-center bg-theme-settings-input-bg rounded-md border border-white/10 pointer-events-auto"
39
- ref = { dropdownRef }
40
- >
35
+ < div className = "absolute top-[calc(40px+16px)] left-4 right-4" >
36
+ < div className = "flex justify-between items-start max-w-[1700px] mx-auto" >
37
+ < div className = "flex items-center gap-x-2" >
41
38
< button
42
39
onClick = { ( ) => navigate ( paths . settings . agentSkills ( ) ) }
43
- className = "border-y-none border-l-none flex items-center gap-x-2 px-4 py-2 border-r border-white/10 hover:bg-theme-action-menu-bg transition-colors duration-300"
40
+ className = "w-8 h-8 flex items-center justify-center rounded-full bg-theme-settings-input-bg border border-white/10 hover:bg-theme-action-menu-bg transition-colors duration-300"
44
41
>
45
- < img
46
- src = { AnythingInfinityLogo }
47
- alt = "logo"
48
- className = "w-[20px] light:invert"
42
+ < CaretLeft
43
+ weight = "bold"
44
+ className = "w-5 h-5 text-theme-text-primary"
49
45
/>
50
- < span className = "text-theme-text-primary text-sm uppercase tracking-widest" >
51
- Builder
52
- </ span >
53
46
</ button >
54
- < div className = "relative" >
47
+ < div
48
+ className = "flex items-center bg-theme-settings-input-bg rounded-md border border-white/10 pointer-events-auto"
49
+ ref = { dropdownRef }
50
+ >
55
51
< button
56
- disabled = { ! hasOtherFlows }
57
- className = "border-none flex items-center justify-between gap-x-1 text-theme-text-primary text-sm px-4 py-2 enabled:hover:bg-theme-action-menu-bg transition-colors duration-300 min-w-[200px] max-w-[300px]"
58
- onClick = { ( ) => {
59
- if ( ! agentName && ! hasOtherFlows ) {
60
- const agentNameInput = document . getElementById (
61
- "agent-flow-name-input"
62
- ) ;
63
- if ( agentNameInput ) agentNameInput . focus ( ) ;
64
- return ;
65
- }
66
- setShowDropdown ( ! showDropdown ) ;
67
- } }
52
+ onClick = { ( ) => navigate ( paths . settings . agentSkills ( ) ) }
53
+ className = "!border-t-transparent !border-l-transparent !border-b-transparent flex items-center gap-x-2 px-4 py-2 border-r border-white/10 hover:bg-theme-action-menu-bg transition-colors duration-300"
68
54
>
69
- < span
70
- className = { `text-sm font-medium truncate ${ ! ! agentName ? "text-theme-text-primary " : "text-theme-text-secondary" } ` }
71
- >
72
- { agentName || "Untitled Flow" }
55
+ < img
56
+ src = { AnythingInfinityLogo }
57
+ alt = "logo"
58
+ className = "w-[20px] light:invert"
59
+ />
60
+ < span className = "text-theme-text-primary text-sm uppercase tracking-widest" >
61
+ Builder
73
62
</ span >
74
- { hasOtherFlows && (
75
- < div className = "flex flex-col ml-2 shrink-0" >
76
- < CaretUp size = { 10 } />
77
- < CaretDown size = { 10 } />
63
+ </ button >
64
+ < div className = "relative" >
65
+ < button
66
+ disabled = { ! hasOtherFlows }
67
+ className = "border-none flex items-center justify-between gap-x-1 text-theme-text-primary text-sm px-4 py-2 enabled:hover:bg-theme-action-menu-bg transition-colors duration-300 min-w-[200px] max-w-[300px]"
68
+ onClick = { ( ) => {
69
+ if ( ! agentName && ! hasOtherFlows ) {
70
+ const agentNameInput = document . getElementById (
71
+ "agent-flow-name-input"
72
+ ) ;
73
+ if ( agentNameInput ) agentNameInput . focus ( ) ;
74
+ return ;
75
+ }
76
+ setShowDropdown ( ! showDropdown ) ;
77
+ } }
78
+ >
79
+ < span
80
+ className = { `text-sm font-medium truncate ${ ! ! agentName ? "text-theme-text-primary " : "text-theme-text-secondary" } ` }
81
+ >
82
+ { agentName || "Untitled Flow" }
83
+ </ span >
84
+ { hasOtherFlows && (
85
+ < div className = "flex flex-col ml-2 shrink-0" >
86
+ < CaretUp size = { 10 } />
87
+ < CaretDown size = { 10 } />
88
+ </ div >
89
+ ) }
90
+ </ button >
91
+ { showDropdown && (
92
+ < div className = "absolute top-full left-0 mt-1 w-full min-w-[200px] max-w-[350px] bg-theme-settings-input-bg border border-white/10 rounded-md shadow-lg z-50 animate-fadeUpIn" >
93
+ { availableFlows
94
+ . filter ( ( flow ) => flow . uuid !== flowId )
95
+ . map ( ( flow ) => (
96
+ < button
97
+ key = { flow ?. uuid || Math . random ( ) }
98
+ onClick = { ( ) => {
99
+ navigate ( paths . agents . editAgent ( flow . uuid ) ) ;
100
+ setShowDropdown ( false ) ;
101
+ } }
102
+ className = "border-none w-full text-left px-2 py-1 text-sm text-theme-text-primary hover:bg-theme-action-menu-bg transition-colors duration-300"
103
+ >
104
+ < span className = "block truncate" >
105
+ { flow ?. name || "Untitled Flow" }
106
+ </ span >
107
+ </ button >
108
+ ) ) }
78
109
</ div >
79
110
) }
80
- </ button >
81
- { showDropdown && (
82
- < div className = "absolute top-full left-0 mt-1 w-full min-w-[200px] max-w-[350px] bg-theme-settings-input-bg border border-white/10 rounded-md shadow-lg z-50 animate-fadeUpIn" >
83
- { availableFlows
84
- . filter ( ( flow ) => flow . uuid !== flowId )
85
- . map ( ( flow ) => (
86
- < button
87
- key = { flow ?. uuid || Math . random ( ) }
88
- onClick = { ( ) => {
89
- navigate ( paths . agents . editAgent ( flow . uuid ) ) ;
90
- setShowDropdown ( false ) ;
91
- } }
92
- className = "border-none w-full text-left px-2 py-1 text-sm text-theme-text-primary hover:bg-theme-action-menu-bg transition-colors duration-300"
93
- >
94
- < span className = "block truncate" >
95
- { flow ?. name || "Untitled Flow" }
96
- </ span >
97
- </ button >
98
- ) ) }
99
- </ div >
100
- ) }
111
+ </ div >
101
112
</ div >
102
113
</ div >
103
114
@@ -112,7 +123,7 @@ export default function HeaderMenu({
112
123
</ button >
113
124
< button
114
125
onClick = { onSaveFlow }
115
- className = "border-none bg-primary-button hover:opacity-80 text-black px-3 py-2 rounded-lg text-sm font-medium transition-all duration-300 flex items-center justify-center gap-2"
126
+ className = "border-none bg-primary-button hover:opacity-80 text-black light:text-white px-3 py-2 rounded-lg text-sm font-medium transition-all duration-300 flex items-center justify-center gap-2"
116
127
>
117
128
Save
118
129
</ button >
0 commit comments