@shutootaki/gwm
Version:
git worktree manager CLI
20 lines • 1 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Text, Box } from 'ink';
import InkSpinner from 'ink-spinner';
/**
* Spinner with progress display
*
* Usage:
* <ProgressSpinner label="Removing worktrees..." />
* <ProgressSpinner
* label="Removing worktrees..."
* progress={{ current: 3, total: 5, detail: '/path/to/worktree' }}
* />
*/
export const ProgressSpinner = ({ label, sublabel, progress, color = 'cyan', }) => {
const progressText = progress
? ` (${progress.current}/${progress.total})`
: '';
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { children: [_jsx(Text, { color: color, children: _jsx(InkSpinner, { type: "dots" }) }), ' ', label, progressText, sublabel && _jsxs(Text, { color: "gray", children: [" - ", sublabel] })] }), progress?.detail && (_jsx(Box, { marginLeft: 2, children: _jsx(Text, { color: "gray", children: progress.detail }) }))] }));
};
//# sourceMappingURL=ProgressSpinner.js.map