This commit is contained in:
parent
2ac04f9d92
commit
106b240a15
|
|
@ -17,9 +17,14 @@ import { FC, useContext, useEffect, useState } from "react"
|
||||||
import { Button } from "../ui/button"
|
import { Button } from "../ui/button"
|
||||||
import { Input } from "../ui/input"
|
import { Input } from "../ui/input"
|
||||||
|
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
interface WorkspaceSwitcherProps {}
|
interface WorkspaceSwitcherProps {}
|
||||||
|
|
||||||
export const WorkspaceSwitcher: FC<WorkspaceSwitcherProps> = ({}) => {
|
export const WorkspaceSwitcher: FC<WorkspaceSwitcherProps> = ({}) => {
|
||||||
|
|
||||||
|
const { t } = useTranslation()
|
||||||
|
|
||||||
useHotkey(";", () => setOpen(prevState => !prevState))
|
useHotkey(";", () => setOpen(prevState => !prevState))
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|
@ -60,7 +65,7 @@ export const WorkspaceSwitcher: FC<WorkspaceSwitcherProps> = ({}) => {
|
||||||
selectedWorkspace.include_workspace_instructions,
|
selectedWorkspace.include_workspace_instructions,
|
||||||
instructions: selectedWorkspace.instructions,
|
instructions: selectedWorkspace.instructions,
|
||||||
is_home: false,
|
is_home: false,
|
||||||
name: "New Workspace"
|
name: t("side.newWorkspace")
|
||||||
})
|
})
|
||||||
|
|
||||||
setWorkspaces([...workspaces, createdWorkspace])
|
setWorkspaces([...workspaces, createdWorkspace])
|
||||||
|
|
@ -124,7 +129,7 @@ export const WorkspaceSwitcher: FC<WorkspaceSwitcherProps> = ({}) => {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{getWorkspaceName(value) || "Select workspace..."}
|
{getWorkspaceName(value) || t("side.selectWorkspace")}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ChevronsUpDown className="ml-2 size-4 shrink-0 opacity-50" />
|
<ChevronsUpDown className="ml-2 size-4 shrink-0 opacity-50" />
|
||||||
|
|
@ -138,11 +143,11 @@ export const WorkspaceSwitcher: FC<WorkspaceSwitcherProps> = ({}) => {
|
||||||
onClick={handleCreateWorkspace}
|
onClick={handleCreateWorkspace}
|
||||||
>
|
>
|
||||||
<IconPlus />
|
<IconPlus />
|
||||||
<div className="ml-2">New Workspace</div>
|
<div className="ml-2">{t("side.newWorkspace")}</div>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Input
|
<Input
|
||||||
placeholder="Search workspaces..."
|
placeholder={t("side.searchWorkspaces")}
|
||||||
autoFocus
|
autoFocus
|
||||||
value={search}
|
value={search}
|
||||||
onChange={e => setSearch(e.target.value)}
|
onChange={e => setSearch(e.target.value)}
|
||||||
|
|
|
||||||
|
|
@ -124,5 +124,13 @@
|
||||||
"groqApiKeySetByAdmin": "Groq API Key set by admin.",
|
"groqApiKeySetByAdmin": "Groq API Key set by admin.",
|
||||||
"perplexityApiKeySetByAdmin": "Perplexity API Key set by admin.",
|
"perplexityApiKeySetByAdmin": "Perplexity API Key set by admin.",
|
||||||
"openRouterApiKeySetByAdmin": "OpenRouter API Key set by admin."
|
"openRouterApiKeySetByAdmin": "OpenRouter API Key set by admin."
|
||||||
}
|
},
|
||||||
|
|
||||||
|
"side": {
|
||||||
|
"selectWorkspace": "Select workspace...",
|
||||||
|
"newWorkspace": "New Workspace",
|
||||||
|
"searchWorkspaces": "Search workspaces...",
|
||||||
|
"noWorkspacesFound": "No workspaces found"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,14 @@
|
||||||
"groqApiKeySetByAdmin": "Groq API キーは管理者によって設定されました。",
|
"groqApiKeySetByAdmin": "Groq API キーは管理者によって設定されました。",
|
||||||
"perplexityApiKeySetByAdmin": "Perplexity API キーは管理者によって設定されました。",
|
"perplexityApiKeySetByAdmin": "Perplexity API キーは管理者によって設定されました。",
|
||||||
"openRouterApiKeySetByAdmin": "OpenRouter API キーは管理者によって設定されました。"
|
"openRouterApiKeySetByAdmin": "OpenRouter API キーは管理者によって設定されました。"
|
||||||
}
|
},
|
||||||
|
|
||||||
|
"side": {
|
||||||
|
"selectWorkspace": "ワークスペースを選択...",
|
||||||
|
"newWorkspace": "新しいワークスペース",
|
||||||
|
"searchWorkspaces": "ワークスペースを検索...",
|
||||||
|
"noWorkspacesFound": "ワークスペースが見つかりません"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -123,5 +123,13 @@
|
||||||
"groqApiKeySetByAdmin": "Groq API 密钥由管理员设置。",
|
"groqApiKeySetByAdmin": "Groq API 密钥由管理员设置。",
|
||||||
"perplexityApiKeySetByAdmin": "Perplexity API 密钥由管理员设置。",
|
"perplexityApiKeySetByAdmin": "Perplexity API 密钥由管理员设置。",
|
||||||
"openRouterApiKeySetByAdmin": "OpenRouter API 密钥由管理员设置。"
|
"openRouterApiKeySetByAdmin": "OpenRouter API 密钥由管理员设置。"
|
||||||
|
},
|
||||||
|
|
||||||
|
"side": {
|
||||||
|
"selectWorkspace": "选择工作区...",
|
||||||
|
"newWorkspace": "新建工作区",
|
||||||
|
"searchWorkspaces": "搜索工作区...",
|
||||||
|
"noWorkspacesFound": "未找到工作区"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue