import clsx from 'clsx'; import { isLimitedToBE } from '@/portainer/feature-flags/feature-flags.service'; import { Icon } from '@/react/components/Icon'; import './BoxSelectorItem.css'; import { BoxSelectorOption } from './types'; import { LimitedToBeIndicator } from './LimitedToBeIndicator'; import { BoxOption } from './BoxOption'; interface Props { radioName: string; option: BoxSelectorOption; onChange(value: T, limitedToBE: boolean): void; selectedValue: T; disabled?: boolean; tooltip?: string; } export function BoxSelectorItem({ radioName, option, onChange, selectedValue, disabled, tooltip, }: Props) { const limitedToBE = isLimitedToBE(option.feature); const beIndicatorTooltipId = `box-selector-item-${radioName}-${option.id}-limited`; return ( onChange(value, limitedToBE)} tooltip={tooltip} > <> {limitedToBE && ( )}
{!!option.icon && ( )}
{option.label}

{option.description}

); }