import { Box, Text } from 'ink'; import { useEffect } from 'react'; import { useJourney } from '../context/provider.js'; import { FullfilledState } from '../context/types.js'; import { colors } from '../../../../config/colors.js'; import downloadBoilerplate from '../../../use-cases/downloadBoilerplate.js'; import { Spinner } from '../../../components/Spinner.js'; import React from 'react'; export const DownloadProject: React.FC = () => { const { state, dispatch } = useJourney(); useEffect(() => { downloadBoilerplate(state.boilerplate, state.folder) .then(() => dispatch.boilerplateDownloaded()) .catch(console.error); }, []); if (state.isDownloaded) { return ( The boilerplate has been successfully downloaded. ); } return ( <> Downloading the {state.boilerplate.name} boilerplate... ); };