Skip to content

Commit 021c3bb

Browse files
committed
perf: show help link in api key mgm dialog
1 parent 0a64a96 commit 021c3bb

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

web/src/app/home/components/api-key-management-dialog/ApiKeyManagementDialog.tsx

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import {
3636
} from '@/components/ui/alert-dialog';
3737
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
3838
import { backendClient } from '@/app/infra/http';
39+
import { extractI18nObject } from '@/i18n/I18nProvider';
3940

4041
interface ApiKey {
4142
id: number;
@@ -155,7 +156,32 @@ export default function ApiKeyManagementDialog({
155156
<DialogContent className="sm:max-w-[700px]">
156157
<DialogHeader>
157158
<DialogTitle>{t('common.manageApiKeys')}</DialogTitle>
158-
<DialogDescription>{t('common.apiKeyHint')}</DialogDescription>
159+
<DialogDescription>
160+
<span className="cursor-pointer flex items-center gap-1">
161+
{t('common.apiKeyHint')}
162+
<div
163+
onClick={() => {
164+
window.open(
165+
extractI18nObject({
166+
zh_Hans: 'https://docs.langbot.app/zh/tags/readme',
167+
en_US: 'https://docs.langbot.app/en/tags/readme',
168+
}),
169+
'_blank',
170+
);
171+
}}
172+
className="cursor-pointer"
173+
>
174+
<svg
175+
className="w-[1rem] h-[1rem]"
176+
xmlns="http://www.w3.org/2000/svg"
177+
viewBox="0 0 24 24"
178+
fill="currentColor"
179+
>
180+
<path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM13 13.3551V14H11V12.5C11 11.9477 11.4477 11.5 12 11.5C12.8284 11.5 13.5 10.8284 13.5 10C13.5 9.17157 12.8284 8.5 12 8.5C11.2723 8.5 10.6656 9.01823 10.5288 9.70577L8.56731 9.31346C8.88637 7.70919 10.302 6.5 12 6.5C13.933 6.5 15.5 8.067 15.5 10C15.5 11.5855 14.4457 12.9248 13 13.3551Z"></path>
181+
</svg>
182+
</div>
183+
</span>
184+
</DialogDescription>
159185
</DialogHeader>
160186

161187
<div className="space-y-4">

0 commit comments

Comments
 (0)