summaryrefslogtreecommitdiff
path: root/packages/create-astro/src/components/Header.tsx
blob: 0684d1b3cc32cb189e29e5560eadcdd4511e9189 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import React from 'react';
import { Box, Text } from 'ink';

const getMessage = ({ projectName, template }) => {
  switch (true) {
    case !projectName:
      return <Text dimColor>Gathering mission details</Text>;
    case !template:
      return <Text dimColor>Optimizing navigational system</Text>;
    default:
      return (
        <Text color="black" backgroundColor="white">
          {' '}
          {projectName}{' '}
        </Text>
      );
  }
};

const Header: React.FC<{ context: any }> = ({ context }) => (
  <Box width={48} display="flex" marginY={1}>
    <Text backgroundColor="#882DE7" color="white">
      {' astro '}
    </Text>
    <Box marginLeft={1}>{getMessage(context)}</Box>
  </Box>
);
export default Header;