33// ============================================================================
44
55import type { SelectOption } from '@opentui/core' ;
6+ import { useKeyboard } from '@opentui/react' ;
67import { useEffect , useMemo , useState } from 'react' ;
78import {
89 checkDockerStatus ,
@@ -176,6 +177,12 @@ export function DockerSetup({
176177 onComplete ( { type : 'cancelled' } ) ;
177178 } ;
178179
180+ useKeyboard ( ( key ) => {
181+ if ( key . name === 'escape' ) {
182+ handleCancel ( ) ;
183+ }
184+ } ) ;
185+
179186 // ---- Checking State ----
180187 if ( state . type === 'checking' ) {
181188 return (
@@ -199,9 +206,12 @@ export function DockerSetup({
199206 padding : 1 ,
200207 flexDirection : 'column' ,
201208 flexGrow : 1 ,
209+ alignItems : 'center' ,
210+ justifyContent : 'center' ,
202211 } }
203212 >
204- < text style = { { fg : '#00cc00' } } > Docker is running!</ text >
213+ < text style = { { fg : '#0c0' } } > Docker is running!</ text >
214+ < text style = { { fg : '#555555' , marginTop : 1 } } > Press Esc to exit</ text >
205215 </ box >
206216 </ box >
207217 ) ;
@@ -214,7 +224,8 @@ export function DockerSetup({
214224 return (
215225 < Loading
216226 title = { title }
217- message = { `${ state . message } \nThis may take a minute while ${ providerName } initializes` }
227+ message = { state . message }
228+ detail = { `This may take a minute while ${ providerName } initializes` }
218229 onCancel = { handleCancel }
219230 />
220231 ) ;
@@ -227,7 +238,8 @@ export function DockerSetup({
227238 return (
228239 < Loading
229240 title = { title }
230- message = { `Installing ${ providerName } ...\nThis may take a few minutes.` }
241+ message = { `Installing ${ providerName } ` }
242+ detail = "This may take a few minutes."
231243 onCancel = { handleCancel }
232244 />
233245 ) ;
@@ -245,6 +257,8 @@ export function DockerSetup({
245257 padding : 1 ,
246258 flexDirection : 'column' ,
247259 flexGrow : 1 ,
260+ alignItems : 'center' ,
261+ justifyContent : 'center' ,
248262 } }
249263 >
250264 < text style = { { fg : '#ff4444' } } > Error: { state . message } </ text >
0 commit comments