mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-06-08 10:02:59 -07:00
48 lines
1.0 KiB
TypeScript
48 lines
1.0 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import type React from 'react';
|
|
import { Box, Text } from 'ink';
|
|
import { theme } from '../semantic-colors.js';
|
|
import { ApprovalMode } from '@google/gemini-cli-core';
|
|
|
|
interface ApprovalModeIndicatorProps {
|
|
approvalMode: ApprovalMode;
|
|
}
|
|
|
|
export const ApprovalModeIndicator: React.FC<ApprovalModeIndicatorProps> = ({
|
|
approvalMode,
|
|
}) => {
|
|
let textColor = '';
|
|
let textContent = '';
|
|
|
|
switch (approvalMode) {
|
|
case ApprovalMode.AUTO_EDIT:
|
|
textColor = theme.status.warning;
|
|
textContent = 'auto-accept';
|
|
break;
|
|
case ApprovalMode.PLAN:
|
|
textColor = theme.status.success;
|
|
textContent = 'plan';
|
|
break;
|
|
case ApprovalMode.YOLO:
|
|
textColor = theme.status.error;
|
|
textContent = 'YOLO';
|
|
break;
|
|
case ApprovalMode.DEFAULT:
|
|
default:
|
|
textColor = theme.text.accent;
|
|
textContent = 'manual';
|
|
break;
|
|
}
|
|
|
|
return (
|
|
<Box>
|
|
<Text color={textColor}>{textContent}</Text>
|
|
</Box>
|
|
);
|
|
};
|