UNPKG

giga-code

Version:

A personal AI CLI assistant powered by Grok for local development.

36 lines 2.06 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.FileFinder = void 0; const react_1 = __importDefault(require("react")); const ink_1 = require("ink"); function FileFinder({ files, selectedIndex, query, isVisible, maxItems = 8 }) { if (!isVisible || files.length === 0) { return null; } const displayFiles = files.slice(0, maxItems); return (react_1.default.createElement(ink_1.Box, { flexDirection: "column", marginTop: 1 }, react_1.default.createElement(ink_1.Box, { borderStyle: "round", borderColor: "cyan", paddingX: 1 }, react_1.default.createElement(ink_1.Box, { flexDirection: "column" }, react_1.default.createElement(ink_1.Text, { color: "cyan", bold: true }, query.endsWith('/') ? '📁 Directories matching' : '📄 Files matching', " \"@", query, "\""), displayFiles.map((file, index) => { const isDirectory = file.endsWith('/'); const icon = isDirectory ? '📁' : '📄'; return (react_1.default.createElement(ink_1.Box, { key: index, paddingLeft: 1 }, react_1.default.createElement(ink_1.Text, { color: index === selectedIndex ? "black" : "white", backgroundColor: index === selectedIndex ? "cyan" : undefined }, index === selectedIndex ? "▶ " : " ", icon, " ", file))); }), react_1.default.createElement(ink_1.Box, { marginTop: 1, paddingX: 1 }, react_1.default.createElement(ink_1.Text, { color: "gray", dimColor: true }, "\u2191\u2193 navigate \u2022 Enter select \u2022 Esc cancel")))))); } exports.FileFinder = FileFinder; //# sourceMappingURL=file-finder.js.map