diff --git a/src-web/components/core/SegmentedControl.tsx b/src-web/components/core/SegmentedControl.tsx index 3ed7bf41..4241a7b5 100644 --- a/src-web/components/core/SegmentedControl.tsx +++ b/src-web/components/core/SegmentedControl.tsx @@ -1,3 +1,4 @@ +import classNames from 'classnames'; import { useRef } from 'react'; import { useStateWithDeps } from '../../hooks/useStateWithDeps'; import type { IconProps } from './Icon'; @@ -18,10 +19,10 @@ export function SegmentedControl({ value, onChange, options, n return ( { const selectedIndex = options.findIndex((o) => o.value === selectedValue); if (e.key === 'ArrowRight') { @@ -37,20 +38,30 @@ export function SegmentedControl({ value, onChange, options, n } }} > - {options.map((o, i) => ( - onChange(o.value)} - /> - ))} + {options.map((o, i) => { + const isSelected = selectedValue === o.value; + const isActive = value === o.value; + return ( + onChange(o.value)} + /> + ); + })} ); }