UNPKG

@basictech/cli

Version:

Basic CLI for creating & managing your projects

15 lines 676 B
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import React from 'react'; import { Text } from 'ink'; const spinnerFrames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏']; export const Spinner = ({ text = 'Loading...' }) => { const [frame, setFrame] = React.useState(0); React.useEffect(() => { const timer = setInterval(() => { setFrame(prev => (prev + 1) % spinnerFrames.length); }, 80); return () => clearInterval(timer); }, []); return (_jsxs(Text, { children: [_jsx(Text, { color: "cyan", children: spinnerFrames[frame] }), " ", text] })); }; //# sourceMappingURL=Spinner.js.map