import {
DropdownMenu,
DropdownMenuTrigger,
DropdownMenuContent,
DropdownMenuItem,
} from '../../basic/dropdown-menu'
import { ArrowDownSLine, CheckLine } from '../../basic/icons-inline'
import type { FooterLeftModelSwitchConfig } from './types'
export interface ChatInputModelSwitcherProps {
config: FooterLeftModelSwitchConfig
disabled: boolean
arrowDownIcon?: React.ReactNode
dataStyle?: string
dataTheme?: string
}
export function ChatInputModelSwitcher({
config,
disabled,
dataStyle,
dataTheme,
arrowDownIcon = ,
}: ChatInputModelSwitcherProps) {
const currentModeOption = config.modeSwitch.options.find((o) => o.value === config.modeSwitch.value)
const modeTriggerIcon = currentModeOption?.icon ?? config.modeSwitch.icon
return (
{config.modeSwitch.options.map((opt) => (
config.modeSwitch.onChange(opt.value)}
className="flex items-center justify-between gap-2"
>
{opt.icon != null && (
{opt.icon}
)}
{opt.label}
{config.modeSwitch.value === opt.value && (
)}
))}
{config.modelSwitch.options.map((opt) => (
config.modelSwitch.onChange(opt.value)}
className="flex items-center justify-between gap-2"
>
{opt.label}
{config.modelSwitch.value === opt.value && (
)}
))}
{config.consumptionMultiplier.options != null &&
config.consumptionMultiplier.options.length > 0 &&
config.consumptionMultiplier.onChange != null ? (
{config.consumptionMultiplier.options.map((opt) => (
config.consumptionMultiplier.onChange?.(opt.value)}
className="flex items-center justify-between gap-2"
>
{opt.label}
{config.consumptionMultiplier.value === opt.value && (
)}
))}
) : (
{config.consumptionMultiplier.value}
)}
)
}
ChatInputModelSwitcher.displayName = 'ChatInputModelSwitcher'