({
customAsciiArt,
version,
nightly,
})
| 19 | } |
| 20 | |
| 21 | export const Header: React.FC<HeaderProps> = ({ |
| 22 | customAsciiArt, |
| 23 | version, |
| 24 | nightly, |
| 25 | }) => { |
| 26 | const { columns: terminalWidth } = useTerminalSize(); |
| 27 | let displayTitle; |
| 28 | const widthOfLongLogo = getAsciiArtWidth(longAsciiLogo); |
| 29 | const widthOfShortLogo = getAsciiArtWidth(shortAsciiLogo); |
| 30 | |
| 31 | if (customAsciiArt) { |
| 32 | displayTitle = customAsciiArt; |
| 33 | } else if (terminalWidth >= widthOfLongLogo) { |
| 34 | displayTitle = longAsciiLogo; |
| 35 | } else if (terminalWidth >= widthOfShortLogo) { |
| 36 | displayTitle = shortAsciiLogo; |
| 37 | } else { |
| 38 | displayTitle = tinyAsciiLogo; |
| 39 | } |
| 40 | |
| 41 | const artWidth = getAsciiArtWidth(displayTitle); |
| 42 | |
| 43 | // Bold, warm power gradient (non-rainbow): orange → red → magenta → violet |
| 44 | const powerGradient = ['#ff6a00', '#ff2a00', '#ff006e', '#b300ff']; |
| 45 | |
| 46 | return ( |
| 47 | <Box |
| 48 | alignItems="flex-start" |
| 49 | width={artWidth} |
| 50 | flexShrink={0} |
| 51 | flexDirection="column" |
| 52 | marginBottom={1} |
| 53 | > |
| 54 | <Gradient colors={powerGradient}> |
| 55 | <Text bold>{displayTitle}</Text> |
| 56 | </Gradient> |
| 57 | {nightly && ( |
| 58 | <Box |
| 59 | width="100%" |
| 60 | flexDirection="row" |
| 61 | justifyContent="flex-end" |
| 62 | marginTop={1} |
| 63 | > |
| 64 | <Gradient colors={powerGradient}> |
| 65 | <Text bold>v{version}</Text> |
| 66 | </Gradient> |
| 67 | </Box> |
| 68 | )} |
| 69 | </Box> |
| 70 | ); |
| 71 | }; |
nothing calls this directly
no test coverage detected