"use client"; import Link from "next/link"; import { useCallback, type SetStateAction } from "react"; import { ArrowRight } from "lucide-react"; import { useTranslation } from "react-i18next"; import { APP_LANGUAGES, isAppLanguage, type AppLanguage } from "@/i18n/init"; import AgentSetupHelp from "@/components/settings/AgentSetupHelp"; import { SettingRow, SettingSection, SettingsPageHeader, selectClass, selectOptionClass, } from "./shared"; import { RESPONSE_LANGUAGE_OPTIONS, useUiSettings } from "@/features/settings/store"; import { useSettings } from "@/features/settings/store/SettingsStore"; import { useStagedSettings } from "@/features/settings/store/useStagedSettings"; import { useUiLayout } from "@/hooks/useUiLayout"; import { UI_LAYOUTS, writeStoredUiLayout, type UiLayout } from "@/lib/ui-layout"; const UI_LAYOUT_LABELS: Record = { classic: "Classic", modern: "Modern", }; function LanguageSelect({ label, value, onChange, }: { label: string; value: string; onChange: (next: AppLanguage) => void; }) { const { t } = useTranslation(); return ( ); } export default function SettingsOverview() { const { t } = useTranslation(); const { language, responseLanguage, updateLanguage, updateResponseLanguage } = useUiSettings(); const { catalogEditable } = useSettings(); const uiLayout = useUiLayout(); const setLiveUiLayout = useCallback( (action: SetStateAction) => writeStoredUiLayout(typeof action === "function" ? action(uiLayout) : action), [uiLayout], ); const [stagedUiLayout, stageUiLayout] = useStagedSettings( "ui-layout", uiLayout, setLiveUiLayout, ); return (
} /> void updateResponseLanguage( event.target.value as typeof responseLanguage, ) } className={`${selectClass} min-w-[200px] pr-8`} > {RESPONSE_LANGUAGE_OPTIONS.map((option) => ( ))} } /> stageUiLayout(event.target.value as UiLayout)} className={`${selectClass} min-w-[200px] pr-8`} > {UI_LAYOUTS.map((layout) => ( ))} } /> {catalogEditable && {[ { href: "/settings/connections", title: t("1. Connect a provider"), description: t("Add your provider and credentials, then test the connection."), }, { href: "/settings/llm", title: t("2. Choose a chat model"), description: t("Add a language model, test it, and select it as the default for conversations."), }, { href: "/settings/status", title: t("3. Apply and check"), description: t("Apply your changes using the bottom bar, then check service status before starting a conversation."), }, ].map((item) => (
{item.title}

{item.description}

))}
} {catalogEditable && {[ { href: "/settings/embedding", title: t("Knowledge search"), description: t("Configure an embedding model before indexing a knowledge base.") }, { href: "/settings/search", title: t("Web search"), description: t("Connect a search service to find information on the web.") }, { href: "/settings/task-models", title: t("Background task models"), description: t("Choose models for automatic tasks such as titles and suggestions.") }, ].map(item => (
{item.title}

{item.description}

))}
}
); }