import React, { useEffect, useMemo } from 'react'; import { Label } from '@renderer/components/ui/label'; import { useEffectiveCliProviderStatus } from '@renderer/hooks/useEffectiveCliProviderStatus'; import { cn } from '@renderer/lib/utils'; import { getTeamEffortSelectorPresentation } from '@renderer/utils/teamEffortOptions'; import { Brain } from 'lucide-react'; import type { TeamProviderId } from '@shared/types'; export interface EffortLevelSelectorProps { value: string; onValueChange: (value: string) => void; id?: string; providerId?: TeamProviderId; model?: string; limitContext?: boolean; } export const EffortLevelSelector: React.FC = ({ value, onValueChange, id, providerId, model, limitContext, }) => { const { providerStatus } = useEffectiveCliProviderStatus(providerId); const presentation = getTeamEffortSelectorPresentation({ providerId, model, limitContext, providerStatus, }); const effortOptions = presentation.options; const validValues = useMemo( () => new Set(effortOptions.map((option) => option.value)), [effortOptions] ); const showsAnthropicMax = providerId === 'anthropic' && effortOptions.some((option) => option.value === 'max'); useEffect(() => { if (!presentation.canValidateValue || !value || validValues.has(value)) { return; } onValueChange(''); }, [onValueChange, presentation.canValidateValue, validValues, value]); return (
{effortOptions.map((opt) => ( ))}

{presentation.helperText}

{presentation.unavailableText ? (

{presentation.unavailableText}

) : null} {showsAnthropicMax ? (

Max is Anthropic's heavier reasoning mode and only appears when the resolved launch model supports it.

) : null}
); };