1- import { ScrollBoxRenderable , TextareaRenderable , TextAttributes } from "@opentui/core"
1+ import { ScrollBoxRenderable , TextareaRenderable } from "@opentui/core"
22import { useTerminalDimensions } from "@opentui/solid"
33import type {
44 ConnectionInfo ,
@@ -21,7 +21,7 @@ import { useClient } from "../context/client"
2121import { Keymap } from "../context/keymap"
2222import { useLocation } from "../context/location"
2323import { useTheme } from "../context/theme"
24- import { useDialog } from "../ui/dialog"
24+ import { DialogHeader , useDialog } from "../ui/dialog"
2525import { DialogPrompt } from "../ui/dialog-prompt"
2626import { DialogSelect } from "../ui/dialog-select"
2727import { Link } from "../ui/link"
@@ -510,14 +510,7 @@ function CommandView(props: { title: string; output: string; message: string })
510510 onMount ( ( ) => dialog . setSize ( "large" ) )
511511 return (
512512 < box gap = { 1 } paddingBottom = { 1 } >
513- < box flexDirection = "row" justifyContent = "space-between" paddingLeft = { 2 } paddingRight = { 2 } >
514- < text attributes = { TextAttributes . BOLD } fg = { theme . text . base } >
515- { props . title }
516- </ text >
517- < text fg = { theme . text . muted } onMouseUp = { ( ) => dialog . clear ( ) } >
518- esc close
519- </ text >
520- </ box >
513+ < DialogHeader paddingX = { 2 } title = { props . title } closeLabel = "esc close" />
521514 < box
522515 backgroundColor = { overlayTheme . background . raised . high }
523516 paddingLeft = { 2 }
@@ -801,18 +794,10 @@ function OAuthView(props: {
801794 copy ?: boolean
802795 open ?: boolean
803796} ) {
804- const dialog = useDialog ( )
805797 const theme = useTheme ( ) . surface ( "dialog" )
806798 return (
807799 < box paddingLeft = { 2 } paddingRight = { 2 } gap = { 1 } paddingBottom = { 1 } >
808- < box flexDirection = "row" justifyContent = "space-between" >
809- < text attributes = { TextAttributes . BOLD } fg = { theme . text . base } >
810- { props . title }
811- </ text >
812- < text fg = { theme . text . muted } onMouseUp = { ( ) => dialog . clear ( ) } >
813- esc
814- </ text >
815- </ box >
800+ < DialogHeader title = { props . title } />
816801 < Show when = { props . url } >
817802 { ( url ) => (
818803 < box gap = { 1 } >
@@ -986,14 +971,7 @@ function StringChoiceField(props: {
986971 } ) )
987972 return (
988973 < box paddingLeft = { 4 } paddingRight = { 4 } paddingBottom = { 1 } gap = { 1 } >
989- < box flexDirection = "row" justifyContent = "space-between" >
990- < text fg = { theme . text . base } attributes = { TextAttributes . BOLD } >
991- { formLabel ( props . field ) }
992- </ text >
993- < text fg = { theme . text . muted } onMouseUp = { ( ) => ( store . editing ? back ( ) : dialog . clear ( ) ) } >
994- esc
995- </ text >
996- </ box >
974+ < DialogHeader title = { formLabel ( props . field ) } onClose = { ( ) => ( store . editing ? back ( ) : dialog . clear ( ) ) } />
997975 < Show when = { props . field . description } > { ( description ) => < text fg = { theme . text . muted } > { description ( ) } </ text > } </ Show >
998976 < scrollbox
999977 gap = { 1 }
0 commit comments