@@ -10,7 +10,6 @@ export type View = 'apps' | 'local' | 'web'
1010
1111const Apps = ( ) : JSX . Element => {
1212 const { appsList } = useAppStore ( )
13- const [ tooltips , setTooltips ] = useState < string [ ] > ( [ ] )
1413 const [ enabled , setEnabled ] = useState ( false )
1514 const [ sEnabled , setSEnabled ] = useState ( false )
1615 const [ appIndex , setAppIndex ] = useState ( - 1 )
@@ -72,7 +71,7 @@ const Apps = (): JSX.Element => {
7271 }
7372
7473 return (
75- < div className = "h-svh w-[100%] flex flex-col justify-between items-center" >
74+ < div className = "h-vh w-[100%] flex flex-col justify-between items-center" >
7675 < div className = "pt-5 w-full flex justify-center" >
7776 { displayRequest && currentRequest [ 1 ] && currentRequest [ 0 ] && (
7877 < AppRequestOverlay
@@ -86,11 +85,11 @@ const Apps = (): JSX.Element => {
8685 < AppSettingsOverlay appIndex = { appIndex } setEnabled = { setSEnabled } data = { appsList } />
8786 ) }
8887 { appsList ?. apps ?. length > 0 && Object . keys ( appsList . apps ) . length > 0 ? (
89- < div className = "pt-5 w-full flex xl:flex-row xl:flex-wrap flex-col items-center gap-2" >
88+ < div className = "pt-5 w-full flex xl:flex-row xl:flex-wrap xl:gap-5 xl:px-5 flex-col items-center gap-2" >
9089 { ( appsList . apps as App [ ] ) . map ( ( app , appIndex ) => (
9190 < div
9291 key = { appIndex }
93- className = "border-2 border-zinc-400 p-5 w-11/12 md:w-11/12 xl:w-fit h-fit flex justify-between rounded-3xl shadow-lg px-5 items-center"
92+ className = "border-2 border-zinc-400 p-5 w-11/12 md:w-11/12 xl:w-fit xl:gap-5 h-fit flex justify-between rounded-3xl shadow-lg px-5 items-center"
9493 >
9594 < div className = "flex flex-wrap sm:flex-nowrap gap-2 xl:mr-2" >
9695 < button
@@ -112,175 +111,86 @@ const Apps = (): JSX.Element => {
112111 < p className = "text-zinc-400 text-xs font-geistMono" > { app . manifest ?. version } </ p >
113112 </ div >
114113 </ div >
115- { appsWithActiveRequests . includes ( app . name ) ? (
116- < div className = "flex items-center md:flex-row flex-col" >
117- { tooltips [ appIndex ] ? (
118- < p > { tooltips [ appIndex ] } </ p >
114+ < div className = "flex md:items-center items-end justify-end md:flex-row flex-col xl:w-96" >
115+ < div className = "flex-col flex font-geistMono items-end pr-2" >
116+ { app . running ? (
117+ < p className = "text-green-500" > Running</ p >
118+ ) : app . enabled ? (
119+ < p className = "text-red-600" > Stopped</ p >
119120 ) : (
120- < p className = "text-blue-300" > Data Request </ p >
121+ < p className = "text-zinc-600 pr-2" > Disabled </ p >
121122 ) }
122- < button
123- className = "border-2 border-blue-600 hover:bg-blue-500 m-1 p-2 rounded-lg"
124- onClick = { ( ) => handleRequestTrigger ( app . name ) }
125- onMouseEnter = { ( ) =>
126- setTooltips ( ( prevTooltips ) => ( {
127- ...prevTooltips ,
128- [ appIndex ] : 'Handle Request'
129- } ) )
130- }
131- onMouseLeave = { ( ) =>
132- setTooltips ( ( prevTooltips ) => ( {
133- ...prevTooltips ,
134- [ appIndex ] : ''
135- } ) )
136- }
137- >
138- < IconPulsing />
139- </ button >
140- < button
141- className = "border-2 border-red-600 hover:bg-red-500 p-2 rounded-lg"
142- onClick = { ( ) => handleDisableApp ( app . name ) }
143- onMouseEnter = { ( ) =>
144- setTooltips ( ( prevTooltips ) => ( {
145- ...prevTooltips ,
146- [ appIndex ] : 'Disable App'
147- } ) )
148- }
149- onMouseLeave = { ( ) =>
150- setTooltips ( ( prevTooltips ) => ( {
151- ...prevTooltips ,
152- [ appIndex ] : ''
153- } ) )
154- }
155- >
156- < IconX />
157- </ button >
158123 </ div >
159- ) : app . enabled ? (
160- < div className = "flex items-center md:flex-row flex-col" >
161- < div className = "flex-col flex font-geistMono items-end pr-2" >
162- { tooltips [ appIndex ] ? (
163- < p className = "text-white" > { tooltips [ appIndex ] } </ p >
164- ) : app . running ? (
165- < p className = "text-green-500" > Running</ p >
166- ) : (
167- < p className = "text-red-600" > Stopped</ p >
168- ) }
169- </ div >
170- { app . running ? (
124+ { appsWithActiveRequests . includes ( app . name ) && (
125+ < div className = "flex items-center md:flex-row flex-col" >
171126 < button
172- className = "border-2 border-amber-600 hover:bg-amber-500 m-1 p-2 rounded-lg"
173- onClick = { ( ) => handleStopApp ( app . name ) }
174- onMouseEnter = { ( ) =>
175- setTooltips ( ( prevTooltips ) => ( {
176- ...prevTooltips ,
177- [ appIndex ] : 'Pause App'
178- } ) )
179- }
180- onMouseLeave = { ( ) =>
181- setTooltips ( ( prevTooltips ) => ( {
182- ...prevTooltips ,
183- [ appIndex ] : ''
184- } ) )
185- }
127+ className = "group flex border-2 gap-3 border-blue-600 hover:bg-blue-500 m-1 p-2 rounded-lg"
128+ onClick = { ( ) => handleRequestTrigger ( app . name ) }
186129 >
187- < IconPause />
130+ < p className = "group-hover:block hidden text-white" >
131+ Handle< p className = "hidden lg:inline" > Request</ p >
132+ </ p >
133+ < IconPulsing />
188134 </ button >
189- ) : (
135+ </ div >
136+ ) }
137+ { app . enabled ? (
138+ < >
139+ { app . running ? (
140+ < button
141+ className = "group flex gap-3 border-2 border-amber-600 hover:bg-amber-500 mx-1 p-2 rounded-lg"
142+ onClick = { ( ) => handleStopApp ( app . name ) }
143+ >
144+ < p className = "group-hover:block hidden text-white" >
145+ Pause< p className = "hidden lg:inline" > App</ p >
146+ </ p >
147+ < IconPause />
148+ </ button >
149+ ) : (
150+ < button
151+ className = "gap-3 flex group border-2 border-cyan-600 hover:bg-cyan-500 mx-1 p-2 rounded-lg"
152+ onClick = { ( ) => handleAddAndRunApp ( app . name ) }
153+ >
154+ < p className = "group-hover:block hidden text-white" >
155+ Run< p className = "hidden lg:inline" > App</ p >
156+ </ p >
157+ < IconPlay />
158+ </ button >
159+ ) }
190160 < button
191- className = "border-2 border-cyan-600 hover:bg-cyan-500 m-1 p-2 rounded-lg"
192- onClick = { ( ) => handleAddAndRunApp ( app . name ) }
193- onMouseEnter = { ( ) =>
194- setTooltips ( ( prevTooltips ) => ( {
195- ...prevTooltips ,
196- [ appIndex ] : 'Run App'
197- } ) )
198- }
199- onMouseLeave = { ( ) =>
200- setTooltips ( ( prevTooltips ) => ( {
201- ...prevTooltips ,
202- [ appIndex ] : ''
203- } ) )
204- }
161+ className = "flex gap-3 group border-2 border-red-600 hover:bg-red-500 mx-1 p-2 rounded-lg"
162+ onClick = { ( ) => handleDisableApp ( app . name ) }
205163 >
206- < IconPlay />
164+ < p className = "group-hover:block hidden text-white" >
165+ Disable< p className = "hidden lg:inline" > App</ p >
166+ </ p >
167+ < IconX />
207168 </ button >
208- ) }
169+ </ >
170+ ) : (
209171 < button
210- className = "border-2 border-red-600 hover:bg-red-500 p-2 rounded-lg"
211- onClick = { ( ) => handleDisableApp ( app . name ) }
212- onMouseEnter = { ( ) =>
213- setTooltips ( ( prevTooltips ) => ( {
214- ...prevTooltips ,
215- [ appIndex ] : 'Disable App'
216- } ) )
217- }
218- onMouseLeave = { ( ) =>
219- setTooltips ( ( prevTooltips ) => ( {
220- ...prevTooltips ,
221- [ appIndex ] : ''
222- } ) )
223- }
224- >
225- < IconX />
226- </ button >
227- </ div >
228- ) : (
229- < div className = "flex items-center md:flex-row flex-col" >
230- { tooltips [ appIndex ] ? (
231- < p > { tooltips [ appIndex ] } </ p >
232- ) : (
233- < p className = "text-zinc-600" > Disabled</ p >
234- ) }
235- < button
236- className = "border-2 border-cyan-600 hover:bg-cyan-500 m-1 p-2 rounded-lg"
172+ className = "group gap-3 flex border-2 border-cyan-600 hover:bg-cyan-500 mx-1 p-2 rounded-lg"
237173 onClick = { ( ) => handleAddAndRunApp ( app . name ) }
238- onMouseEnter = { ( ) =>
239- setTooltips ( ( prevTooltips ) => ( {
240- ...prevTooltips ,
241- [ appIndex ] : 'Enable App'
242- } ) )
243- }
244- onMouseLeave = { ( ) =>
245- setTooltips ( ( prevTooltips ) => ( {
246- ...prevTooltips ,
247- [ appIndex ] : ''
248- } ) )
249- }
250174 >
175+ < p className = "group-hover:block hidden text-white" >
176+ Enable< p className = "hidden lg:inline" > App</ p >
177+ </ p >
251178 < IconPlay />
252179 </ button >
253- < button
254- onClick = { ( ) => handleDetails ( appIndex ) }
255- className = "border-2 top-10 border-green-600 hover:bg-green-500 p-2 rounded-lg"
256- onMouseEnter = { ( ) =>
257- setTooltips ( ( prevTooltips ) => ( {
258- ...prevTooltips ,
259- [ appIndex ] : 'App Details'
260- } ) )
261- }
262- onMouseLeave = { ( ) =>
263- setTooltips ( ( prevTooltips ) => ( {
264- ...prevTooltips ,
265- [ appIndex ] : ''
266- } ) )
267- }
268- >
269- < IconDetails iconSize = { 24 } />
270- </ button >
271- </ div >
272- ) }
180+ ) }
181+ </ div >
273182 </ div >
274183 ) ) }
275184 </ div >
276185 ) : (
277- < div className = "border-2 border-zinc-200 p-5 w-[90%] h-fit flex justify-center rounded-3xl shadow-lg px-5 align-baseline" >
186+ < div className = "border-2 border-zinc-200 p-5 w-[90%] h-fit flex flex-col items-center gap-5 justify-center rounded-3xl shadow-lg px-5 align-baseline" >
278187 < button
279188 className = "border-2 border-cyan-600 hover:bg-cyan-500 bg-cyan-600 p-2 rounded-lg"
280189 onClick = { ( ) => requestAppsList ( ) }
281190 >
282- Request Apps
191+ Refresh Apps List
283192 </ button >
193+ < p className = "italic text-gray-500" > Are any downloaded?</ p >
284194 </ div >
285195 ) }
286196 </ div >
0 commit comments