import { jsx as _jsx } from "react/jsx-runtime";
import { Box, Text } from "ink";
import { buildProgressBarParts } from "../design/ProgressBar.js";
export function ratchetModel(value, width = 10) {
    const parts = buildProgressBarParts(value, width, { filled: "#", empty: "-" });
    return {
        value: parts.ratio,
        width: Math.max(0, Math.floor(width)),
        cells: `${parts.filled}${parts.empty}`,
    };
}
export function Ratchet(props) {
    const model = ratchetModel(props.value, props.width);
    return (_jsx(Box, { children: _jsx(Text, { color: "cyan", children: model.cells }) }));
}
