/* * SPDX-FileCopyrightText: 2026 Coffey Labs * * SPDX-License-Identifier: AGPL-3.0-only */ import { useTranslation } from 'react-i18next'; import ReactMarkdown from 'react-markdown'; import { ArrowUpRight, Info } from 'lucide-react'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'; import { cn } from '@/lib/utils'; import { manualUrl } from './manual'; /** * The ⓘ beside an option: a sentence or two on what it does, on hover or * focus, and a way into the manual once there is one. `id` is the option's * stable help id, the key the manual links hang on. */ export function HelpTip({ id, text, footnote, className, }: { id?: string; text?: string | null; /** A short line under the text, like the option's default. */ footnote?: string | null; className?: string; }) { const { t } = useTranslation(); if (!text && !footnote) return null; const more = id ? manualUrl(id) : null; return (
{text && {text.replace(/\\n/g, '\n')}}
{footnote &&

{footnote}

} {more && ( {t('help.learnMore', 'Learn more')} )}
); }