UNPKG

@lucidlayer/traceform-onboard

Version:

Interactive CLI tool and onboarding wizard for setting up, validating, and configuring Traceform in React projects. Automates project setup, developer onboarding, and toolchain validation for React, TypeScript, and monorepos.

31 lines (30 loc) 1.96 kB
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime"; /* // SPDX-License-Identifier: Apache-2.0 */ import { useState } from 'react'; import { Box, Text, useInput } from 'ink'; const BrowserStep = ({ onComplete, stepIndex, totalSteps }) => { const [confirmed, setConfirmed] = useState(null); const [answered, setAnswered] = useState(false); // Removed detailed installation guide link; instructions are provided inline now. // Use Ink's useInput hook for confirmation useInput((input, key) => { if (!answered && confirmed === null) { if (key.return) { setConfirmed(true); setAnswered(true); onComplete(true); } } }, { isActive: confirmed === null }); // Add universal quit handler useInput((input, key) => { if (input.toLowerCase() === 'q') { onComplete(false); return; } }); return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { color: "cyan", children: ["Step ", stepIndex, " of ", totalSteps] }), _jsx(Text, { bold: true, children: "--- Step 4: Browser Extension ---" }), _jsx(Text, { color: "yellow", children: "Install the Traceform Browser Extension from the Chrome Web Store:" }), _jsx(Text, { children: "1. Open the Chrome Web Store page" }), _jsx(Text, { color: "cyan", children: "https://chromewebstore.google.com/detail/giidcepndnnabhfkopmgcnpnnilkaefa?utm_source=item-share-cb" }), _jsx(Text, { children: "2. Click \"Add to Chrome\"" }), confirmed === null && _jsx(Text, { color: "yellow", children: "Press Enter to continue or Q to quit" }), confirmed === true && _jsx(Text, { color: "green", children: "\u2714 Browser Extension step confirmed." }), confirmed === false && _jsx(Text, { color: "red", children: "\u2716 Browser Extension step not confirmed. Please install/enable the extension and restart the wizard." })] })); }; export default BrowserStep;