summaryrefslogtreecommitdiff
path: root/packages/create-astro/src/components/Finalize.tsx
blob: c7aeaad3677f33d1230d7cba22ebcf281fe59ec8 (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
29
30
31
32
33
34
35
import React, { FC, useEffect } from 'react';
import { Box, Text } from 'ink';
import { relative } from 'path';
import { cancelProcessListeners } from '../utils';

const Finalize: FC<{ context: any }> = ({ context: { use, projectName } }) => {
  useEffect(() => {
    cancelProcessListeners();
    process.exit(0);
  }, []);

  const projectPath = `./${relative(process.cwd(), projectName)}`;

  return (
    <>
      <Box display="flex">
        <Text color="#17C083">{'[ yes ]'}</Text>
        <Text>
          {' '}
          Project initialized at <Text color="#3894FF">{projectPath}</Text>
        </Text>
      </Box>
      <Box display="flex" marginY={1}>
        <Text dimColor>{'[ tip ]'}</Text>
        <Box display="flex" marginLeft={1} flexDirection="column">
          <Text>Get started by running</Text>
          <Text color="#3894FF">cd {projectPath}</Text>
          <Text color="#3894FF">{use} start</Text>
        </Box>
      </Box>
    </>
  );
};

export default Finalize;