Some checks are pending
E2E / Playwright e2e (push) Waiting to run
- Introduced new components for managing admin settings, including AdminListControls, AdminSettingsCard, and TechBrandSelectLabel. - Implemented dynamic loading for admin settings sections to optimize performance. - Enhanced the layout of various admin settings sections for better user experience. - Updated the AiAssistantSection to include LLM provider management and improved model selection. - Refactored authentication settings to streamline configuration and improve accessibility.
61 lines
2.0 KiB
TypeScript
61 lines
2.0 KiB
TypeScript
"use client"
|
|
|
|
import Link from "next/link"
|
|
import { Label } from "@/components/ui/label"
|
|
import { Switch } from "@/components/ui/switch"
|
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
|
|
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 (
|
|
<Card>
|
|
<CardHeader className="pb-3">
|
|
<CardTitle className="text-sm font-medium">Tools UltiAI</CardTitle>
|
|
<CardDescription>
|
|
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).
|
|
</CardDescription>
|
|
</CardHeader>
|
|
<CardContent className="space-y-2">
|
|
{ULTIAI_TOOL_GROUPS.map((group) => {
|
|
const checked = enabledTools.includes(group.id)
|
|
return (
|
|
<label
|
|
key={group.id}
|
|
className="flex items-start justify-between gap-4 rounded-lg border p-3"
|
|
>
|
|
<div className="min-w-0">
|
|
<Label className="text-sm font-medium">{group.label}</Label>
|
|
<p className="mt-0.5 text-xs text-muted-foreground">{group.description}</p>
|
|
</div>
|
|
<Switch
|
|
checked={checked}
|
|
onCheckedChange={(enabled) =>
|
|
onChange(toggleUltiAiToolGroup(enabledTools, group.id, enabled))
|
|
}
|
|
/>
|
|
</label>
|
|
)
|
|
})}
|
|
</CardContent>
|
|
</Card>
|
|
)
|
|
}
|