mirror of
https://github.com/FranP-code/ChatGPT.git
synced 2025-10-13 00:13:25 +00:00
chore: window
This commit is contained in:
30
src/components/SwitchOrigin/index.tsx
vendored
Normal file
30
src/components/SwitchOrigin/index.tsx
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import { FC } from 'react';
|
||||
import { Form, Select, Tag } from 'antd';
|
||||
|
||||
import useJson from '@/hooks/useJson';
|
||||
import { DISABLE_AUTO_COMPLETE, CHAT_CONF_JSON, CHAT_AWESOME_JSON } from '@/utils';
|
||||
|
||||
interface SwitchOriginProps {
|
||||
name: string;
|
||||
}
|
||||
|
||||
const SwitchOrigin: FC<SwitchOriginProps> = ({ name }) => {
|
||||
const { json: list = [] } = useJson<any[]>(CHAT_AWESOME_JSON);
|
||||
|
||||
return (
|
||||
<Form.Item
|
||||
label={<span>Switch Origin ({name === 'origin' ? 'Main' : 'SystemTray'})</span>}
|
||||
name={name}
|
||||
>
|
||||
<Select showSearch {...DISABLE_AUTO_COMPLETE} optionLabelProp="url">
|
||||
{[{ title: 'ChatGPT', url: 'https://chat.openai.com' }, ...list].map((i) => (
|
||||
<Select.Option key={i.url} label={i.title} value={i.url}>
|
||||
<Tag color="geekblue">{i.title}</Tag> {i.url}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
);
|
||||
};
|
||||
|
||||
export default SwitchOrigin;
|
||||
Reference in New Issue
Block a user