@@ -8,6 +8,8 @@ import { useRouter, useSearchParams } from "next/navigation";
88import React , { useCallback , useEffect , useMemo , useState , useTransition } from "react" ;
99import { FaSearch , FaTimesCircle } from "react-icons/fa" ;
1010
11+ import { PageActions } from "./PageActions" ;
12+
1113export const UserSearch = ( ) => {
1214 const [ error , setError ] = useState < string | null > ( null ) ;
1315 const [ purchases , setPurchases ] = useState < OrderResponse [ ] > ( [ ] ) ;
@@ -71,46 +73,50 @@ export const UserSearch = () => {
7173 ) ;
7274
7375 return (
74- < Stack >
75- < Center >
76- < Stack w = "60%" justify = "centre" align = "centre" >
77- < form
78- style = { {
79- width : "100%" ,
80- display : "flex" ,
81- justifyContent : "center" ,
82- alignItems : "center" ,
83- } }
84- action = { submitActionWithTransition }
85- >
86- < Group w = "100%" >
87- < TextInput
88- placeholder = "Enter shortcode"
89- leftSection = { < FaSearch /> }
90- w = "60%"
91- flex = { 1 }
92- required
93- name = "shortcode"
94- id = "shortcode"
95- onChange = { ( e ) => setSetshortcodeFormState ( e . currentTarget . value ) }
96- value = { shortcodeFormState }
97- />
98- < Button loading = { isPending } type = "submit" >
99- Submit
100- </ Button >
101- </ Group >
102- </ form >
103- { error && (
104- < Alert title = "Error" color = "red" mt = "md" icon = { < FaTimesCircle /> } >
105- { error }
106- </ Alert >
107- ) }
108- </ Stack >
109- </ Center >
110- < Center >
111- < UserInfo shortcode = { shortcode } />
112- </ Center >
113- < Container w = "70%" >
76+ < Container w = "70%" >
77+ < Stack gap = "lg" >
78+ < PageActions />
79+ < Center >
80+ < Stack w = "90%" justify = "centre" align = "centre" >
81+ < form
82+ style = { {
83+ width : "100%" ,
84+ display : "flex" ,
85+ justifyContent : "center" ,
86+ alignItems : "center" ,
87+ } }
88+ action = { submitActionWithTransition }
89+ >
90+ < Group w = "100%" >
91+ < TextInput
92+ placeholder = "Enter shortcode"
93+ leftSection = { < FaSearch /> }
94+ w = "60%"
95+ flex = { 1 }
96+ required
97+ name = "shortcode"
98+ id = "shortcode"
99+ onChange = { ( e ) =>
100+ setSetshortcodeFormState ( e . currentTarget . value )
101+ }
102+ value = { shortcodeFormState }
103+ />
104+ < Button loading = { isPending } type = "submit" >
105+ Submit
106+ </ Button >
107+ </ Group >
108+ </ form >
109+ { error && (
110+ < Alert title = "Error" color = "red" mt = "md" icon = { < FaTimesCircle /> } >
111+ { error }
112+ </ Alert >
113+ ) }
114+ </ Stack >
115+ </ Center >
116+ < Center >
117+ < UserInfo shortcode = { shortcode } />
118+ </ Center >
119+
114120 { ! error ? (
115121 < BuyerItemsTable
116122 shortcode = { shortcode }
@@ -120,7 +126,7 @@ export const UserSearch = () => {
120126 ) : (
121127 < > </ >
122128 ) }
123- </ Container >
124- </ Stack >
129+ </ Stack >
130+ </ Container >
125131 ) ;
126132} ;
0 commit comments