This commit is contained in:
parent
106b240a15
commit
509a0ea3d7
|
|
@ -8,12 +8,17 @@ import { WorkspaceSwitcher } from "../utility/workspace-switcher"
|
||||||
import { WorkspaceSettings } from "../workspace/workspace-settings"
|
import { WorkspaceSettings } from "../workspace/workspace-settings"
|
||||||
import { SidebarContent } from "./sidebar-content"
|
import { SidebarContent } from "./sidebar-content"
|
||||||
|
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
interface SidebarProps {
|
interface SidebarProps {
|
||||||
contentType: ContentType
|
contentType: ContentType
|
||||||
showSidebar: boolean
|
showSidebar: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Sidebar: FC<SidebarProps> = ({ contentType, showSidebar }) => {
|
export const Sidebar: FC<SidebarProps> = ({ contentType, showSidebar }) => {
|
||||||
|
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
folders,
|
folders,
|
||||||
chats,
|
chats,
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,14 @@ import { TextareaAutosize } from "../ui/textarea-autosize"
|
||||||
import { WithTooltip } from "../ui/with-tooltip"
|
import { WithTooltip } from "../ui/with-tooltip"
|
||||||
import { DeleteWorkspace } from "./delete-workspace"
|
import { DeleteWorkspace } from "./delete-workspace"
|
||||||
|
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
interface WorkspaceSettingsProps {}
|
interface WorkspaceSettingsProps {}
|
||||||
|
|
||||||
export const WorkspaceSettings: FC<WorkspaceSettingsProps> = ({}) => {
|
export const WorkspaceSettings: FC<WorkspaceSettingsProps> = ({}) => {
|
||||||
|
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
profile,
|
profile,
|
||||||
selectedWorkspace,
|
selectedWorkspace,
|
||||||
|
|
@ -168,7 +173,7 @@ export const WorkspaceSettings: FC<WorkspaceSettingsProps> = ({}) => {
|
||||||
<Sheet open={isOpen} onOpenChange={setIsOpen}>
|
<Sheet open={isOpen} onOpenChange={setIsOpen}>
|
||||||
<SheetTrigger asChild>
|
<SheetTrigger asChild>
|
||||||
<WithTooltip
|
<WithTooltip
|
||||||
display={<div>Workspace Settings</div>}
|
display={<div>{t("side.workspaceSettings")}</div>}
|
||||||
trigger={
|
trigger={
|
||||||
<IconSettings
|
<IconSettings
|
||||||
className="ml-3 cursor-pointer pr-[5px] hover:opacity-50"
|
className="ml-3 cursor-pointer pr-[5px] hover:opacity-50"
|
||||||
|
|
@ -187,30 +192,30 @@ export const WorkspaceSettings: FC<WorkspaceSettingsProps> = ({}) => {
|
||||||
<div className="grow overflow-auto">
|
<div className="grow overflow-auto">
|
||||||
<SheetHeader>
|
<SheetHeader>
|
||||||
<SheetTitle className="flex items-center justify-between">
|
<SheetTitle className="flex items-center justify-between">
|
||||||
Workspace Settings
|
{t("side.workspaceSettings")}
|
||||||
{selectedWorkspace?.is_home && <IconHome />}
|
{selectedWorkspace?.is_home && <IconHome />}
|
||||||
</SheetTitle>
|
</SheetTitle>
|
||||||
|
|
||||||
{selectedWorkspace?.is_home && (
|
{selectedWorkspace?.is_home && (
|
||||||
<div className="text-sm font-light">
|
<div className="text-sm font-light">
|
||||||
This is your home workspace for personal use.
|
{t("side.workspaceDescription")}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</SheetHeader>
|
</SheetHeader>
|
||||||
|
|
||||||
<Tabs defaultValue="main">
|
<Tabs defaultValue="main">
|
||||||
<TabsList className="mt-4 grid w-full grid-cols-2">
|
<TabsList className="mt-4 grid w-full grid-cols-2">
|
||||||
<TabsTrigger value="main">Main</TabsTrigger>
|
<TabsTrigger value="main">{t("side.main")}</TabsTrigger>
|
||||||
<TabsTrigger value="defaults">Defaults</TabsTrigger>
|
<TabsTrigger value="defaults">{t("side.defaults")}</TabsTrigger>
|
||||||
</TabsList>
|
</TabsList>
|
||||||
|
|
||||||
<TabsContent className="mt-4 space-y-4" value="main">
|
<TabsContent className="mt-4 space-y-4" value="main">
|
||||||
<>
|
<>
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
<Label>Workspace Name</Label>
|
<Label>{t("side.workspaceName")}</Label>
|
||||||
|
|
||||||
<Input
|
<Input
|
||||||
placeholder="Name..."
|
placeholder={t("side.workspaceNamePlaceholder")}
|
||||||
value={name}
|
value={name}
|
||||||
onChange={e => setName(e.target.value)}
|
onChange={e => setName(e.target.value)}
|
||||||
/>
|
/>
|
||||||
|
|
@ -227,7 +232,7 @@ export const WorkspaceSettings: FC<WorkspaceSettingsProps> = ({}) => {
|
||||||
</div> */}
|
</div> */}
|
||||||
|
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
<Label>Workspace Image</Label>
|
<Label>{t("side.workspaceImage")}</Label>
|
||||||
|
|
||||||
<ImagePicker
|
<ImagePicker
|
||||||
src={imageLink}
|
src={imageLink}
|
||||||
|
|
@ -242,11 +247,11 @@ export const WorkspaceSettings: FC<WorkspaceSettingsProps> = ({}) => {
|
||||||
|
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
<Label>
|
<Label>
|
||||||
How would you like the AI to respond in this workspace?
|
{t("side.aiResponseInstructions")}
|
||||||
</Label>
|
</Label>
|
||||||
|
|
||||||
<TextareaAutosize
|
<TextareaAutosize
|
||||||
placeholder="Instructions... (optional)"
|
placeholder={t("side.workspaceInstructionsPlaceholder")}
|
||||||
value={instructions}
|
value={instructions}
|
||||||
onValueChange={setInstructions}
|
onValueChange={setInstructions}
|
||||||
minRows={5}
|
minRows={5}
|
||||||
|
|
@ -263,7 +268,7 @@ export const WorkspaceSettings: FC<WorkspaceSettingsProps> = ({}) => {
|
||||||
|
|
||||||
<TabsContent className="mt-5" value="defaults">
|
<TabsContent className="mt-5" value="defaults">
|
||||||
<div className="mb-4 text-sm">
|
<div className="mb-4 text-sm">
|
||||||
These are the settings your workspace begins with when selected.
|
{t("side.workspaceBeginSettings")}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ChatSettingsForm
|
<ChatSettingsForm
|
||||||
|
|
@ -287,10 +292,11 @@ export const WorkspaceSettings: FC<WorkspaceSettingsProps> = ({}) => {
|
||||||
<div className="space-x-2">
|
<div className="space-x-2">
|
||||||
<Button variant="ghost" onClick={() => setIsOpen(false)}>
|
<Button variant="ghost" onClick={() => setIsOpen(false)}>
|
||||||
Cancel
|
Cancel
|
||||||
|
{t("side.cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button ref={buttonRef} onClick={handleSave}>
|
<Button ref={buttonRef} onClick={handleSave}>
|
||||||
Save
|
{t("side.save")}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,21 @@
|
||||||
"selectWorkspace": "Select workspace...",
|
"selectWorkspace": "Select workspace...",
|
||||||
"newWorkspace": "New Workspace",
|
"newWorkspace": "New Workspace",
|
||||||
"searchWorkspaces": "Search workspaces...",
|
"searchWorkspaces": "Search workspaces...",
|
||||||
"noWorkspacesFound": "No workspaces found"
|
"noWorkspacesFound": "No workspaces found",
|
||||||
|
"workspaceSettings": "Workspace Settings",
|
||||||
|
"workspaceImage": "Workspace Image",
|
||||||
|
"workspaceName": "Workspace Name",
|
||||||
|
"workspaceInstructions": "Workspace Instructions",
|
||||||
|
"workspaceDescription": "This is your home workspace for personal use.",
|
||||||
|
"save": "Save",
|
||||||
|
"cancel": "Cancel",
|
||||||
|
"howToRespond": "How would you like the AI to respond in this workspace?",
|
||||||
|
"main": "Main",
|
||||||
|
"defaults": "Defaults",
|
||||||
|
"aiResponseInstructions": "How would you like the AI to respond in this workspace?",
|
||||||
|
"workspaceNamePlaceholder": "Name...",
|
||||||
|
"workspaceBeginSettings": "These are the settings your workspace begins with when selected.",
|
||||||
|
"workspaceInstructionsPlaceholder": "Instructions... (optional)"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -129,8 +129,22 @@
|
||||||
"selectWorkspace": "ワークスペースを選択...",
|
"selectWorkspace": "ワークスペースを選択...",
|
||||||
"newWorkspace": "新しいワークスペース",
|
"newWorkspace": "新しいワークスペース",
|
||||||
"searchWorkspaces": "ワークスペースを検索...",
|
"searchWorkspaces": "ワークスペースを検索...",
|
||||||
"noWorkspacesFound": "ワークスペースが見つかりません"
|
"noWorkspacesFound": "ワークスペースが見つかりません",
|
||||||
|
"workspaceSettings": "ワークスペース設定",
|
||||||
|
"workspaceImage": "ワークスペース画像",
|
||||||
|
"workspaceName": "ワークスペース名",
|
||||||
|
"workspaceInstructions": "ワークスペース指示",
|
||||||
|
"workspaceDescription": "これはあなたの個人用のホームワークスペースです",
|
||||||
|
"save": "保存",
|
||||||
|
"cancel": "キャンセル",
|
||||||
|
"howToRespond": "このワークスペースでAIにどのように応答してほしいですか?",
|
||||||
|
"main": "メイン",
|
||||||
|
"defaults": "デフォルト",
|
||||||
|
"aiResponseInstructions": "このワークスペースでAIにどのように応答してほしいですか?",
|
||||||
|
"workspaceNamePlaceholder": "名前を入力...",
|
||||||
|
"workspaceBeginSettings": "これらはワークスペースを選択したときに始まる設定です。",
|
||||||
|
"workspaceInstructionsPlaceholder": "説明...(オプション)"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -129,7 +129,21 @@
|
||||||
"selectWorkspace": "选择工作区...",
|
"selectWorkspace": "选择工作区...",
|
||||||
"newWorkspace": "新建工作区",
|
"newWorkspace": "新建工作区",
|
||||||
"searchWorkspaces": "搜索工作区...",
|
"searchWorkspaces": "搜索工作区...",
|
||||||
"noWorkspacesFound": "未找到工作区"
|
"noWorkspacesFound": "未找到工作区",
|
||||||
|
"workspaceSettings": "工作区设置",
|
||||||
|
"workspaceImage": "工作区图片",
|
||||||
|
"workspaceName": "工作区名称",
|
||||||
|
"workspaceInstructions": "工作区说明",
|
||||||
|
"workspaceDescription": "这是您的个人专用工作区",
|
||||||
|
"save": "保存",
|
||||||
|
"cancel": "取消",
|
||||||
|
"howToRespond": "您希望 AI 如何在此工作区内回应?",
|
||||||
|
"main": "主设置",
|
||||||
|
"defaults": "默认设置",
|
||||||
|
"aiResponseInstructions": "您希望 AI 在此工作区内如何回应?",
|
||||||
|
"workspaceNamePlaceholder": "请输入名称...",
|
||||||
|
"workspaceBeginSettings": "这些是选择此工作区时的初始设置。",
|
||||||
|
"workspaceInstructionsPlaceholder": "说明...(可选)"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue