({
theme,
onBuildFast,
onBuildMax,
onBuildLite,
}: {
theme: ChatTheme
onBuildFast: () => void
onBuildMax: () => void
onBuildLite: () => void
})
| 8 | import type { ChatTheme } from '../types/theme-system' |
| 9 | |
| 10 | export const BuildModeButtons = ({ |
| 11 | theme, |
| 12 | onBuildFast, |
| 13 | onBuildMax, |
| 14 | onBuildLite, |
| 15 | }: { |
| 16 | theme: ChatTheme |
| 17 | onBuildFast: () => void |
| 18 | onBuildMax: () => void |
| 19 | onBuildLite: () => void |
| 20 | }) => { |
| 21 | if (IS_FREEBUFF) return null |
| 22 | |
| 23 | const [hoveredButton, setHoveredButton] = useState<'fast' | 'max' | 'lite' | null>( |
| 24 | null, |
| 25 | ) |
| 26 | const { width } = useTerminalLayout() |
| 27 | const isNarrow = width.is('xs') |
| 28 | |
| 29 | return ( |
| 30 | <box |
| 31 | style={{ |
| 32 | flexDirection: 'column', |
| 33 | gap: 0, |
| 34 | paddingTop: 0, |
| 35 | paddingBottom: 0, |
| 36 | paddingLeft: 1, |
| 37 | }} |
| 38 | > |
| 39 | {isNarrow ? null : ( |
| 40 | <text style={{ wrapMode: 'none' }} selectable={false}> |
| 41 | <span fg={theme.secondary}>Choose an option to build this plan:</span> |
| 42 | </text> |
| 43 | )} |
| 44 | <box |
| 45 | style={{ |
| 46 | flexDirection: 'row', |
| 47 | gap: 1, |
| 48 | }} |
| 49 | > |
| 50 | <Button |
| 51 | style={{ |
| 52 | flexDirection: 'row', |
| 53 | alignItems: 'center', |
| 54 | paddingLeft: 2, |
| 55 | paddingRight: 2, |
| 56 | borderStyle: 'single', |
| 57 | borderColor: |
| 58 | hoveredButton === 'fast' ? theme.foreground : theme.secondary, |
| 59 | customBorderChars: BORDER_CHARS, |
| 60 | }} |
| 61 | onClick={onBuildFast} |
| 62 | onMouseOver={() => setHoveredButton('fast')} |
| 63 | onMouseOut={() => setHoveredButton(null)} |
| 64 | > |
| 65 | <text wrapMode="none"> |
| 66 | <span fg={theme.foreground}>Build DEFAULT</span> |
| 67 | </text> |
nothing calls this directly
no test coverage detected