Files
gemini-cli/packages/cli/src/ui/components/ProQuotaDialog.tsx
T

53 lines
1.2 KiB
TypeScript
Raw Normal View History

2025-08-29 04:19:43 +05:30
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type React from 'react';
import { Box, Text } from 'ink';
import { RadioButtonSelect } from './shared/RadioButtonSelect.js';
2025-09-10 10:57:07 -07:00
import { theme } from '../semantic-colors.js';
2025-08-29 04:19:43 +05:30
interface ProQuotaDialogProps {
fallbackModel: string;
onChoice: (choice: 'retry_later' | 'retry') => void;
2025-08-29 04:19:43 +05:30
}
export function ProQuotaDialog({
fallbackModel,
onChoice,
}: ProQuotaDialogProps): React.JSX.Element {
const items = [
{
label: 'Try again later',
value: 'retry_later' as const,
key: 'retry_later',
2025-08-29 04:19:43 +05:30
},
{
label: `Switch to ${fallbackModel} for the rest of this session`,
value: 'retry' as const,
key: 'retry',
2025-08-29 04:19:43 +05:30
},
];
const handleSelect = (choice: 'retry_later' | 'retry') => {
2025-08-29 04:19:43 +05:30
onChoice(choice);
};
return (
<Box borderStyle="round" flexDirection="column" paddingX={1}>
<Box marginTop={1} marginBottom={1}>
2025-08-29 04:19:43 +05:30
<RadioButtonSelect
items={items}
initialIndex={1}
onSelect={handleSelect}
/>
</Box>
<Text color={theme.text.primary}>
Note: You can always use /model to select a different option.
</Text>
2025-08-29 04:19:43 +05:30
</Box>
);
}