Some checks are pending
E2E / Playwright e2e (push) Waiting to run
- Replaced legacy components with new `SettingsCard`, `SettingsField`, and `SettingsToggleRow` for a unified design. - Enhanced `AdminListControls` to support compact mode and improved pagination controls. - Updated various sections including `AiAssistantSection`, `AuthenticationSection`, and `DriveMountOAuthSection` to utilize new components, streamlining the settings interface. - Improved accessibility and user experience across admin settings with clearer labels and hints. - Deprecated old components while maintaining backward compatibility for existing admin sections.
49 lines
1.4 KiB
TypeScript
49 lines
1.4 KiB
TypeScript
"use client"
|
|
|
|
import Link from "next/link"
|
|
import { SettingsCard, SettingsToggleRow } from "@/components/settings/settings-kit"
|
|
import {
|
|
toggleUltiAiToolGroup,
|
|
ULTIAI_TOOL_GROUPS,
|
|
} from "@/lib/ai/ultiai-tool-groups"
|
|
|
|
type UltiAiToolsCardProps = {
|
|
enabledTools: string[]
|
|
onChange: (enabledTools: string[]) => void
|
|
webSearchSettingsHref?: string
|
|
}
|
|
|
|
export function UltiAiToolsCard({
|
|
enabledTools,
|
|
onChange,
|
|
webSearchSettingsHref = "/mail/settings/automation",
|
|
}: UltiAiToolsCardProps) {
|
|
return (
|
|
<SettingsCard
|
|
title="Tools UltiAI"
|
|
description={
|
|
<>
|
|
Groupes d'outils MCP exposés à l'assistant. La recherche web supporte Brave,
|
|
Bing, DuckDuckGo, SearXNG et API JSON — config dans{" "}
|
|
<Link href={webSearchSettingsHref} className="underline underline-offset-2">
|
|
Automatisations → Recherche
|
|
</Link>{" "}
|
|
(utilisateur) ou Administration → Moteur de recherche (organisation).
|
|
</>
|
|
}
|
|
>
|
|
{ULTIAI_TOOL_GROUPS.map((group) => (
|
|
<SettingsToggleRow
|
|
key={group.id}
|
|
title={group.label}
|
|
description={group.description}
|
|
checked={enabledTools.includes(group.id)}
|
|
onCheckedChange={(enabled) =>
|
|
onChange(toggleUltiAiToolGroup(enabledTools, group.id, enabled))
|
|
}
|
|
/>
|
|
))}
|
|
</SettingsCard>
|
|
)
|
|
}
|