import { ChevronRight, Settings2, Sparkles } from 'lucide-react'; import React from 'react'; import { useTranslation } from '../../../i18n'; import { StatusPill } from '../../Settings/settingsKit'; import { fs } from '../../shared/DialogShell'; import AddonSubRow from '../AddonSubRow'; import { type Addon, getAddonLabel } from './addonModel'; import { AI_ADDON_ICONS, type AiAddonId } from './aiAddons'; import AiSettingsDialog from './AiAdminConfig'; import { useAiAddonTile } from './useAiAddonTile'; /** * The AI addons as one tile at the head of the integration column: the * assistant, AI parsing and MCP as switches in its shelf, and one button to * the dialog that holds their settings, so a page with all three on stays as * short as one with none. */ export default function AiAddonTile({ addons, onToggle, }: { addons: Addon[]; onToggle: (addon: Addon) => void; }): React.ReactElement { const { t } = useTranslation(); const tile = useAiAddonTile(addons); const anyOn = tile.enabledCount > 0; return (

{t('admin.addons.ai.name')}

{t('admin.addons.ai.description')}

{tile.enabledCount}/{addons.length}
{tile.canSetUp && ( )}
{tile.dialogOpen && }
); } /** The assistant is still young; its switch says so with a small accent pill. */ function BetaBadge({ label }: { label: string }): React.ReactElement { return ( {label} ); }