- Updated routing for mail settings to redirect to the new settings layout. - Introduced new account layout and section components for better organization. - Replaced hardcoded paths with constants for account and mail settings to enhance maintainability. - Removed deprecated mail settings layout and integrated it into the new settings structure. - Enhanced user experience by streamlining navigation between account and mail settings.
50 lines
1.5 KiB
TypeScript
50 lines
1.5 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"
|
|
import { MAIL_SETTINGS_BASE_PATH } from "@/lib/mail-settings/settings-nav"
|
|
|
|
type UltiAiToolsCardProps = {
|
|
enabledTools: string[]
|
|
onChange: (enabledTools: string[]) => void
|
|
webSearchSettingsHref?: string
|
|
}
|
|
|
|
export function UltiAiToolsCard({
|
|
enabledTools,
|
|
onChange,
|
|
webSearchSettingsHref = `${MAIL_SETTINGS_BASE_PATH}/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>
|
|
)
|
|
}
|