2
2
3
3
import React , { useMemo , useState } from "react" ;
4
4
import { useRouter } from "next/navigation" ;
5
- import AssistantCard from ". /AgentCard" ;
5
+ import AgentCard from "@/sections/AgentsModal /AgentCard" ;
6
6
import { useUser } from "@/components/user/UserProvider" ;
7
7
import { FilterIcon } from "lucide-react" ;
8
8
import { checkUserOwnsAssistant as checkUserOwnsAgent } from "@/lib/assistants/checkOwnership" ;
@@ -11,6 +11,7 @@ import { MinimalPersonaSnapshot } from "@/app/admin/assistants/interfaces";
11
11
import Text from "@/components-2/Text" ;
12
12
import Modal from "@/components-2/modals/Modal" ;
13
13
import { ModalIds , useModal } from "@/components-2/context/ModalContext" ;
14
+ import SvgFilter from "@/icons/filter" ;
14
15
15
16
interface AgentsSectionProps {
16
17
title : string ;
@@ -26,14 +27,13 @@ function AgentsSection({ title, agents, pinnedAgents }: AgentsSectionProps) {
26
27
}
27
28
28
29
return (
29
- < div className = "p-padding-content flex flex-col gap-spacing-paragraph" >
30
- < Text subheading > { title } </ Text >
31
-
30
+ < div className = "py-padding-content flex flex-col gap-spacing-paragraph" >
31
+ < Text headingH2 > { title } </ Text >
32
32
< div className = "w-full grid grid-cols-1 md:grid-cols-2 gap-spacing-paragraph" >
33
33
{ agents
34
34
. sort ( ( a , b ) => b . id - a . id )
35
35
. map ( ( agent , index ) => (
36
- < AssistantCard
36
+ < AgentCard
37
37
key = { index }
38
38
pinned = { pinnedAgents . map ( ( a ) => a . id ) . includes ( agent . id ) }
39
39
agent = { agent }
@@ -58,15 +58,10 @@ function AgentBadgeSelector({
58
58
} : AgentBadgeSelectorProps ) {
59
59
return (
60
60
< div
61
- className = { `
62
- select-none ${
63
- selected
64
- ? "bg-background-900 text-white"
65
- : "bg-transparent text-text-900"
66
- } w-12 h-5 text-center px-1 py-0.5 rounded-lg cursor-pointer text-[12px] font-normal leading-[10px] border border-black justify-center items-center gap-1 inline-flex`}
61
+ className = { `bg-background-tint-03 hover:bg-background-tint-02 ${ selected && "bg-action-link-05 hover:bg-action-link-04" } border p-spacing-interline rounded-08` }
67
62
onClick = { toggleFilter }
68
63
>
69
- { text }
64
+ < Text secondaryBody > { text } </ Text >
70
65
</ div >
71
66
) ;
72
67
}
@@ -147,48 +142,25 @@ export default function AgentsModal() {
147
142
) ;
148
143
149
144
return (
150
- < Modal id = { ModalIds . AgentsModal } title = "Agents" >
151
- < div className = "flex flex-col sticky top-0 z-10" >
152
- < div className = "flex px-2 justify-between items-center gap-x-2 mb-0" >
153
- < div className = "h-12 w-full rounded-lg flex-col justify-center items-start gap-2.5 inline-flex" >
154
- < div className = "h-12 rounded-md w-full shadow-[0px_0px_2px_0px_rgba(0,0,0,0.25)] border border-background-300 flex items-center px-3" >
155
- { ! isSearchFocused && (
156
- < svg
157
- xmlns = "http://www.w3.org/2000/svg"
158
- className = "h-5 w-5 text-text-400"
159
- fill = "none"
160
- viewBox = "0 0 24 24"
161
- stroke = "currentColor"
162
- >
163
- < path
164
- strokeLinecap = "round"
165
- strokeLinejoin = "round"
166
- strokeWidth = { 2 }
167
- d = "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
168
- />
169
- </ svg >
170
- ) }
171
- < input
172
- value = { searchQuery }
173
- onChange = { ( e ) => setSearchQuery ( e . target . value ) }
174
- onFocus = { ( ) => setIsSearchFocused ( true ) }
175
- onBlur = { ( ) => setIsSearchFocused ( false ) }
176
- type = "text"
177
- className = "w-full h-full bg-transparent outline-none text-black"
178
- />
179
- </ div >
180
- </ div >
145
+ < Modal id = { ModalIds . AgentsModal } title = "Agents" className = "max-w-[60rem]" >
146
+ < div className = "flex flex-col sticky top-0 z-10 bg-background-tint-01" >
147
+ < div className = "flex flex-row items-center gap-spacing-interline" >
148
+ < input
149
+ className = "w-full h-[3rem] border bg-transparent rounded-08 p-padding-button"
150
+ placeholder = "Search..."
151
+ value = { searchQuery }
152
+ onChange = { ( event ) => setSearchQuery ( event . target . value ) }
153
+ />
181
154
< button
182
155
onClick = { ( ) => router . push ( "/assistants/new" ) }
183
- className = "h-10 cursor-pointer px-6 py-3 bg-background-800 hover:bg-black rounded-md border border-black justify-center items-center gap-2.5 inline-flex "
156
+ className = "p-padding-button bg-background-tint-03 rounded-08 hover:bg-background-tint-02 "
184
157
>
185
- < div className = "text-text-50 text-lg font-normal leading-normal" >
186
- Create
187
- </ div >
158
+ < Text > Create</ Text >
188
159
</ button >
189
160
</ div >
190
- < div className = "px-2 flex py-4 items-center gap-x-2 flex-wrap" >
191
- < FilterIcon className = "text-text-800" size = { 16 } />
161
+
162
+ < div className = "py-padding-content flex items-center gap-spacing-interline flex-wrap" >
163
+ < SvgFilter className = "w-[1.2rem] h-[1.2rem] stroke-text-05" />
192
164
< AgentBadgeSelector
193
165
text = "Pinned"
194
166
selected = { agentFilters [ AgentFilter . Pinned ] }
@@ -211,13 +183,12 @@ export default function AgentsModal() {
211
183
toggleFilter = { ( ) => toggleAgentFilter ( AgentFilter . Public ) }
212
184
/>
213
185
</ div >
214
- < div className = "w-full border-t border-background-200" />
215
186
</ div >
216
187
217
188
< div className = "h-full w-full" >
218
189
{ featuredAgents . length === 0 && allAgents . length === 0 ? (
219
190
< Text
220
- callout
191
+ mainBody
221
192
className = "w-full h-full flex flex-col items-center justify-center"
222
193
>
223
194
No Agents configured yet...
0 commit comments