(t0)
| 28 | isCancelActive?: boolean; |
| 29 | }; |
| 30 | export function Dialog(t0) { |
| 31 | const $ = _c(27); |
| 32 | const { |
| 33 | title, |
| 34 | subtitle, |
| 35 | children, |
| 36 | onCancel, |
| 37 | color: t1, |
| 38 | hideInputGuide, |
| 39 | hideBorder, |
| 40 | inputGuide, |
| 41 | isCancelActive: t2 |
| 42 | } = t0; |
| 43 | const color = t1 === undefined ? "permission" : t1; |
| 44 | const isCancelActive = t2 === undefined ? true : t2; |
| 45 | const exitState = useExitOnCtrlCDWithKeybindings(undefined, undefined, isCancelActive); |
| 46 | let t3; |
| 47 | if ($[0] !== isCancelActive) { |
| 48 | t3 = { |
| 49 | context: "Confirmation", |
| 50 | isActive: isCancelActive |
| 51 | }; |
| 52 | $[0] = isCancelActive; |
| 53 | $[1] = t3; |
| 54 | } else { |
| 55 | t3 = $[1]; |
| 56 | } |
| 57 | useKeybinding("confirm:no", onCancel, t3); |
| 58 | let t4; |
| 59 | if ($[2] !== exitState.keyName || $[3] !== exitState.pending) { |
| 60 | t4 = exitState.pending ? <Text>Press {exitState.keyName} again to exit</Text> : <Byline><KeyboardShortcutHint shortcut="Enter" action="confirm" /><ConfigurableShortcutHint action="confirm:no" context="Confirmation" fallback="Esc" description="cancel" /></Byline>; |
| 61 | $[2] = exitState.keyName; |
| 62 | $[3] = exitState.pending; |
| 63 | $[4] = t4; |
| 64 | } else { |
| 65 | t4 = $[4]; |
| 66 | } |
| 67 | const defaultInputGuide = t4; |
| 68 | let t5; |
| 69 | if ($[5] !== color || $[6] !== title) { |
| 70 | t5 = <Text bold={true} color={color}>{title}</Text>; |
| 71 | $[5] = color; |
| 72 | $[6] = title; |
| 73 | $[7] = t5; |
| 74 | } else { |
| 75 | t5 = $[7]; |
| 76 | } |
| 77 | let t6; |
| 78 | if ($[8] !== subtitle) { |
| 79 | t6 = subtitle && <Text dimColor={true}>{subtitle}</Text>; |
| 80 | $[8] = subtitle; |
| 81 | $[9] = t6; |
| 82 | } else { |
| 83 | t6 = $[9]; |
| 84 | } |
| 85 | let t7; |
| 86 | if ($[10] !== t5 || $[11] !== t6) { |
| 87 | t7 = <Box flexDirection="column">{t5}{t6}</Box>; |
nothing calls this directly
no test coverage detected