File size: 1,163 Bytes
d810ed8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { Box } from 'ink';
import { type Config, AuthType } from '@google/gemini-cli-core';
import { GeminiPrivacyNotice } from './GeminiPrivacyNotice.js';
import { CloudPaidPrivacyNotice } from './CloudPaidPrivacyNotice.js';
import { CloudFreePrivacyNotice } from './CloudFreePrivacyNotice.js';
interface PrivacyNoticeProps {
onExit: () => void;
config: Config;
}
const PrivacyNoticeText = ({
config,
onExit,
}: {
config: Config;
onExit: () => void;
}) => {
const authType = config.getContentGeneratorConfig()?.authType;
switch (authType) {
case AuthType.USE_GEMINI:
return <GeminiPrivacyNotice onExit={onExit} />;
case AuthType.USE_VERTEX_AI:
return <CloudPaidPrivacyNotice onExit={onExit} />;
case AuthType.LOGIN_WITH_GOOGLE:
default:
return <CloudFreePrivacyNotice config={config} onExit={onExit} />;
}
};
export const PrivacyNotice = ({ onExit, config }: PrivacyNoticeProps) => (
<Box borderStyle="round" padding={1} flexDirection="column">
<PrivacyNoticeText config={config} onExit={onExit} />
</Box>
);
|