/** * @license * Copyright 2026 Vybestack LLC * SPDX-License-Identifier: Apache-2.0 */ import type React from 'react'; import { Box, Text } from 'ink'; import { Colors } from '../colors.js'; import { RadioButtonSelect } from './shared/RadioButtonSelect.js'; import type { TrustRule } from '../../config/trustedFolders.js'; import { buildTrustRuleOptions } from '../trustDialogHelpers.js'; import { getBorderStyle } from '../contexts/UnicodeRenderingContext.js'; interface PermissionsTrustRulesListProps { rules: readonly TrustRule[]; onSelect: (rulePath: string) => void; /** The dialog owns focus, so that it can be withdrawn during a write. */ isFocused: boolean; } /** * Lists every configured trust rule so any of them can be revisited without * restarting the CLI in that directory. */ export const PermissionsTrustRulesList: React.FC< PermissionsTrustRulesListProps > = ({ rules, onSelect, isFocused }) => ( Existing trust rules {rules.length === 0 ? ( No folder trust rules are configured yet. ) : ( Select a folder to change: )} {rules.length === 0 ? '(Escape to go back)' : '(Enter to select, Escape to go back)'} );