import { IconCircleCheckFilled } from '@tabler/icons-react' import { Tooltip, TooltipContent, TooltipTrigger } from '@/client/components/ui/tooltip' import { cn } from '@/client/lib/cn' import type { WorkspaceType } from '@/lib/types' import { harnessLabel, harnessIcon } from './harness-presentation' export type HarnessOption = { type: WorkspaceType description: string disabled: boolean disabledReason?: string disabledCommand?: string } type HarnessSelectorProps = { mode?: 'select' | 'action' cardClassName?: string disabled: boolean options: HarnessOption[] selectedType?: WorkspaceType onTypeChange: (type: WorkspaceType) => void } export function HarnessSelector({ mode = 'select', cardClassName, disabled, options, selectedType, onTypeChange }: HarnessSelectorProps) { return (
{options.map(option => ( ))}
) } type HarnessOptionButtonProps = { className?: string option: HarnessOption selected?: boolean onSelect: (type: WorkspaceType) => void } function HarnessOptionButton({ option, selected, onSelect, className }: HarnessOptionButtonProps) { const showDisabledTooltip = Boolean(option.disabledReason) const button = ( ) if (!showDisabledTooltip) return button return ( {option.disabledReason} {option.disabledCommand && ( <>
{option.disabledCommand} )}
) }