mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-21 17:27:54 +00:00
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import { Box } from 'ink';
|
|
import { type Config, AuthType } from '@qwen/qwen-code-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>
|
|
);
|