-
Notifications
You must be signed in to change notification settings - Fork 89
Expand file tree
/
Copy pathindex.tsx
More file actions
50 lines (42 loc) · 1.62 KB
/
Copy pathindex.tsx
File metadata and controls
50 lines (42 loc) · 1.62 KB
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
44
45
46
47
48
49
50
import { Divider, Popover } from 'antd';
import { BookIcon, DownloadIcon, SettingsIcon } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { MenuTooltip } from '../menu-tooltip';
import { Language } from './language.tsx';
import { TooltipsSetting } from './tooltips';
export const Settings = () => {
const { t } = useTranslation();
function openPage(url: string) {
window.open(url, '_blank');
}
const content = (
<div className="flex flex-col space-y-0.5">
<Language />
<TooltipsSetting />
<Divider style={{ margin: '5px 0 5px 0' }} />
<div
className="flex h-[32px] cursor-pointer items-center space-x-2 rounded px-3 text-neutral-300 hover:bg-neutral-700/50"
onClick={() => openPage('https://wiki.sipeed.com/nanokvmusb')}
>
<BookIcon size={16} />
<span>{t('settings.document')}</span>
</div>
<div
className="flex h-[32px] cursor-pointer items-center space-x-2 rounded px-3 text-neutral-300 hover:bg-neutral-700/50"
onClick={() => openPage('https://github.com/sipeed/NanoKVM-USB/releases')}
>
<DownloadIcon size={16} />
<span>{t('settings.download')}</span>
</div>
</div>
);
return (
<MenuTooltip title={t('menu.settings', 'Settings')}>
<Popover content={content} placement="bottomLeft" trigger="click" arrow={false}>
<div className="flex h-[28px] w-[28px] cursor-pointer items-center justify-center rounded text-neutral-300 hover:bg-neutral-700/50 hover:text-white">
<SettingsIcon size={18} />
</div>
</Popover>
</MenuTooltip>
);
};