summaryrefslogtreecommitdiff
path: root/packages/create-astro/src/components/Header.tsx
blob: 1d894a60e6201ddd5e8e6a2dbea8f34c0c88f3ca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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;