2026-03-16 21:10:46 +05:30
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
import { useAtom } from "jotai";
|
2026-04-09 18:10:34 +05:30
|
|
|
import {
|
2026-04-10 19:07:35 +05:30
|
|
|
BookText,
|
2026-04-10 19:53:13 +05:30
|
|
|
Bot,
|
2026-04-09 18:10:34 +05:30
|
|
|
Brain,
|
2026-04-10 19:07:35 +05:30
|
|
|
CircleUser,
|
|
|
|
|
Earth,
|
2026-04-09 18:10:34 +05:30
|
|
|
ImageIcon,
|
2026-04-10 19:07:35 +05:30
|
|
|
ListChecks,
|
2026-04-14 21:26:00 -07:00
|
|
|
ScanEye,
|
2026-04-10 19:53:13 +05:30
|
|
|
UserKey,
|
2026-04-09 18:10:34 +05:30
|
|
|
} from "lucide-react";
|
2026-04-08 18:23:03 +05:30
|
|
|
import dynamic from "next/dynamic";
|
2026-03-16 21:10:46 +05:30
|
|
|
import { useTranslations } from "next-intl";
|
|
|
|
|
import type React from "react";
|
|
|
|
|
import { searchSpaceSettingsDialogAtom } from "@/atoms/settings/settings-dialog.atoms";
|
|
|
|
|
import { SettingsDialog } from "@/components/settings/settings-dialog";
|
2026-04-08 06:48:51 +05:30
|
|
|
|
|
|
|
|
const GeneralSettingsManager = dynamic(
|
2026-04-08 18:23:03 +05:30
|
|
|
() =>
|
|
|
|
|
import("@/components/settings/general-settings-manager").then((m) => ({
|
|
|
|
|
default: m.GeneralSettingsManager,
|
|
|
|
|
})),
|
2026-04-08 06:48:51 +05:30
|
|
|
{ ssr: false }
|
|
|
|
|
);
|
2026-04-14 01:30:30 +05:30
|
|
|
const AgentModelManager = dynamic(
|
2026-04-08 18:23:03 +05:30
|
|
|
() =>
|
2026-04-14 01:30:30 +05:30
|
|
|
import("@/components/settings/agent-model-manager").then((m) => ({
|
|
|
|
|
default: m.AgentModelManager,
|
2026-04-08 18:23:03 +05:30
|
|
|
})),
|
2026-04-08 06:48:51 +05:30
|
|
|
{ ssr: false }
|
|
|
|
|
);
|
|
|
|
|
const LLMRoleManager = dynamic(
|
2026-04-08 18:23:03 +05:30
|
|
|
() =>
|
|
|
|
|
import("@/components/settings/llm-role-manager").then((m) => ({ default: m.LLMRoleManager })),
|
2026-04-08 06:48:51 +05:30
|
|
|
{ ssr: false }
|
|
|
|
|
);
|
|
|
|
|
const ImageModelManager = dynamic(
|
2026-04-08 18:23:03 +05:30
|
|
|
() =>
|
|
|
|
|
import("@/components/settings/image-model-manager").then((m) => ({
|
|
|
|
|
default: m.ImageModelManager,
|
|
|
|
|
})),
|
2026-04-08 06:48:51 +05:30
|
|
|
{ ssr: false }
|
|
|
|
|
);
|
|
|
|
|
const VisionModelManager = dynamic(
|
2026-04-08 18:23:03 +05:30
|
|
|
() =>
|
|
|
|
|
import("@/components/settings/vision-model-manager").then((m) => ({
|
|
|
|
|
default: m.VisionModelManager,
|
|
|
|
|
})),
|
2026-04-08 06:48:51 +05:30
|
|
|
{ ssr: false }
|
|
|
|
|
);
|
|
|
|
|
const RolesManager = dynamic(
|
2026-04-08 18:23:03 +05:30
|
|
|
() => import("@/components/settings/roles-manager").then((m) => ({ default: m.RolesManager })),
|
2026-04-08 06:48:51 +05:30
|
|
|
{ ssr: false }
|
|
|
|
|
);
|
|
|
|
|
const PromptConfigManager = dynamic(
|
2026-04-08 18:23:03 +05:30
|
|
|
() =>
|
|
|
|
|
import("@/components/settings/prompt-config-manager").then((m) => ({
|
|
|
|
|
default: m.PromptConfigManager,
|
|
|
|
|
})),
|
2026-04-08 06:48:51 +05:30
|
|
|
{ ssr: false }
|
|
|
|
|
);
|
|
|
|
|
const PublicChatSnapshotsManager = dynamic(
|
2026-04-08 18:23:03 +05:30
|
|
|
() =>
|
|
|
|
|
import("@/components/public-chat-snapshots/public-chat-snapshots-manager").then((m) => ({
|
|
|
|
|
default: m.PublicChatSnapshotsManager,
|
|
|
|
|
})),
|
2026-04-08 06:48:51 +05:30
|
|
|
{ ssr: false }
|
|
|
|
|
);
|
2026-04-09 00:03:41 +05:30
|
|
|
const TeamMemoryManager = dynamic(
|
2026-04-09 18:10:34 +05:30
|
|
|
() =>
|
|
|
|
|
import("@/components/settings/team-memory-manager").then((m) => ({
|
|
|
|
|
default: m.TeamMemoryManager,
|
|
|
|
|
})),
|
2026-04-09 00:03:41 +05:30
|
|
|
{ ssr: false }
|
|
|
|
|
);
|
2026-03-16 21:10:46 +05:30
|
|
|
|
|
|
|
|
interface SearchSpaceSettingsDialogProps {
|
|
|
|
|
searchSpaceId: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function SearchSpaceSettingsDialog({ searchSpaceId }: SearchSpaceSettingsDialogProps) {
|
|
|
|
|
const t = useTranslations("searchSpaceSettings");
|
|
|
|
|
const [state, setState] = useAtom(searchSpaceSettingsDialogAtom);
|
|
|
|
|
|
|
|
|
|
const navItems = [
|
2026-04-10 19:07:35 +05:30
|
|
|
{ value: "general", label: t("nav_general"), icon: <CircleUser className="h-4 w-4" /> },
|
|
|
|
|
{ value: "roles", label: t("nav_role_assignments"), icon: <ListChecks className="h-4 w-4" /> },
|
2026-04-14 01:30:30 +05:30
|
|
|
{ value: "models", label: t("nav_agent_models"), icon: <Bot className="h-4 w-4" /> },
|
2026-03-16 21:10:46 +05:30
|
|
|
{
|
|
|
|
|
value: "image-models",
|
|
|
|
|
label: t("nav_image_models"),
|
|
|
|
|
icon: <ImageIcon className="h-4 w-4" />,
|
|
|
|
|
},
|
2026-04-07 19:29:24 +02:00
|
|
|
{
|
|
|
|
|
value: "vision-models",
|
|
|
|
|
label: t("nav_vision_models"),
|
2026-04-13 21:36:07 +05:30
|
|
|
icon: <ScanEye className="h-4 w-4" />,
|
2026-04-07 19:29:24 +02:00
|
|
|
},
|
2026-04-10 19:07:35 +05:30
|
|
|
{ value: "team-roles", label: t("nav_team_roles"), icon: <UserKey className="h-4 w-4" /> },
|
2026-03-16 21:10:46 +05:30
|
|
|
{
|
|
|
|
|
value: "prompts",
|
|
|
|
|
label: t("nav_system_instructions"),
|
2026-04-10 19:07:35 +05:30
|
|
|
icon: <BookText className="h-4 w-4" />,
|
2026-03-16 21:10:46 +05:30
|
|
|
},
|
2026-04-09 00:03:41 +05:30
|
|
|
{
|
|
|
|
|
value: "team-memory",
|
|
|
|
|
label: "Team Memory",
|
2026-04-10 19:07:35 +05:30
|
|
|
icon: <Brain className="h-4 w-4" />,
|
2026-04-09 00:03:41 +05:30
|
|
|
},
|
2026-04-10 19:07:35 +05:30
|
|
|
{ value: "public-links", label: t("nav_public_links"), icon: <Earth className="h-4 w-4" /> },
|
2026-03-16 21:10:46 +05:30
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const content: Record<string, React.ReactNode> = {
|
|
|
|
|
general: <GeneralSettingsManager searchSpaceId={searchSpaceId} />,
|
2026-04-14 01:30:30 +05:30
|
|
|
models: <AgentModelManager searchSpaceId={searchSpaceId} />,
|
2026-03-16 21:10:46 +05:30
|
|
|
roles: <LLMRoleManager searchSpaceId={searchSpaceId} />,
|
|
|
|
|
"image-models": <ImageModelManager searchSpaceId={searchSpaceId} />,
|
2026-04-07 19:29:24 +02:00
|
|
|
"vision-models": <VisionModelManager searchSpaceId={searchSpaceId} />,
|
2026-03-16 21:10:46 +05:30
|
|
|
"team-roles": <RolesManager searchSpaceId={searchSpaceId} />,
|
|
|
|
|
prompts: <PromptConfigManager searchSpaceId={searchSpaceId} />,
|
2026-04-09 00:03:41 +05:30
|
|
|
"team-memory": <TeamMemoryManager searchSpaceId={searchSpaceId} />,
|
2026-03-16 21:10:46 +05:30
|
|
|
"public-links": <PublicChatSnapshotsManager searchSpaceId={searchSpaceId} />,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<SettingsDialog
|
|
|
|
|
open={state.open}
|
|
|
|
|
onOpenChange={(open) => setState((prev) => ({ ...prev, open }))}
|
|
|
|
|
title={t("title")}
|
|
|
|
|
navItems={navItems}
|
|
|
|
|
activeItem={state.initialTab}
|
|
|
|
|
onItemChange={(tab) => setState((prev) => ({ ...prev, initialTab: tab }))}
|
|
|
|
|
>
|
|
|
|
|
<div className="pt-4">{content[state.initialTab]}</div>
|
|
|
|
|
</SettingsDialog>
|
|
|
|
|
);
|
|
|
|
|
}
|