import prompts, { PromptObject } from 'prompts'; import { askDemoCloudQuestions } from './cloud.js'; import { askDemoDockerQuestions } from './docker.js'; export const demoQuestions: PromptObject[] = [ { type: 'select', name: 'demo_type', message: 'How do you want to try the app?', choices: [ { title: 'Cloud demo', value: 'cloud' }, { title: 'Local docker image', value: 'docker', disabled: true }, ], }, ]; export const askDemoQuestions: () => Promise = async () => { const response = await prompts(demoQuestions); switch (response.demo_type) { case 'cloud': await askDemoCloudQuestions(); break; case 'docker': await askDemoDockerQuestions(); break; } };