/* Copyright (C) 2023-2026 QuantumNous This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . For commercial licensing, please contact support@quantumnous.com */ import { FileText, Image as ImageIcon, Mic2, Type as TypeIcon, Video, } from 'lucide-react' import { useTranslation } from 'react-i18next' import { cn } from '@/lib/utils' import { Tooltip, TooltipContent, TooltipTrigger, } from '@/components/ui/tooltip' import type { Modality } from '../types' type IconComponent = React.ComponentType<{ className?: string }> const MODALITY_META: Record< Modality, { icon: IconComponent; labelKey: string } > = { text: { icon: TypeIcon, labelKey: 'Text' }, image: { icon: ImageIcon, labelKey: 'Image' }, audio: { icon: Mic2, labelKey: 'Audio' }, video: { icon: Video, labelKey: 'Video' }, file: { icon: FileText, labelKey: 'File' }, } const ALL_MODALITIES: Modality[] = ['text', 'image', 'audio', 'video', 'file'] /** Inline modality icons (used by the quick-stats flow). */ export function ModalityIcons(props: { modalities: Modality[] className?: string }) { const { t } = useTranslation() if (props.modalities.length === 0) { return } return ( {props.modalities.map((modality) => { const meta = MODALITY_META[modality] const Icon = meta.icon return ( } > {t(meta.labelKey)} ) })} ) } /** * 2 × N matrix showing which modalities are supported as input vs output. * Cells with a checkmark indicate support; empty cells show a dash. */ export function ModalitiesMatrix(props: { input: Modality[] output: Modality[] }) { const { t } = useTranslation() const inputSet = new Set(props.input) const outputSet = new Set(props.output) const renderRow = (label: string, set: Set) => ( {label} {ALL_MODALITIES.map((modality) => { const enabled = set.has(modality) const Icon = MODALITY_META[modality].icon return ( ) })} ) return (
{ALL_MODALITIES.map((modality) => ( ))} {renderRow(t('Input'), inputSet)} {renderRow(t('Output'), outputSet)}
{t('Modality')} {t(MODALITY_META[modality].labelKey)}
) }