mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-21 01:07:46 +00:00
Add privacy notice slash command (#2059)
This commit is contained in:
committed by
GitHub
parent
4fbffdf617
commit
a2a46c7c67
42
packages/cli/src/ui/privacy/PrivacyNotice.tsx
Normal file
42
packages/cli/src/ui/privacy/PrivacyNotice.tsx
Normal file
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* @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_PERSONAL:
|
||||
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>
|
||||
);
|
||||
Reference in New Issue
Block a user