MCPcopy Create free account
hub / github.com/anus-dev/ANUS / Header

Function Header

packages/cli/src/ui/components/Header.tsx:21–71  ·  view source on GitHub ↗
({
  customAsciiArt,
  version,
  nightly,
})

Source from the content-addressed store, hash-verified

19}
20
21export 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};

Callers

nothing calls this directly

Calls 2

useTerminalSizeFunction · 0.85
getAsciiArtWidthFunction · 0.85

Tested by

no test coverage detected