1414 * limitations under the License.
1515 */
1616
17- import { ChangeEvent , useState } from 'react'
17+ import { useState } from 'react'
1818
1919import { ComponentSizeType } from '@Shared/constants'
2020
21- import { stopPropagation , StyledRadioGroup , VisibleModal } from '../../../Common'
21+ import { SegmentedControl , stopPropagation , VisibleModal } from '../../../Common'
2222import { Button , ButtonVariantType } from '../Button'
2323import { DocLink } from '../DocLink'
2424import { BUTTON_TEXT } from './constant'
@@ -104,8 +104,8 @@ export const FeatureDescriptionModal = ({
104104 const [ selectedTabId , setSelectedTabId ] = useState ( tabsConfig ?. [ 0 ] ?. id ?? null )
105105 const selectedTab = tabsConfig ?. find ( ( tab ) => tab . id === selectedTabId ) ?? null
106106
107- const handleSelectedTabChange = ( e : ChangeEvent < HTMLInputElement > ) => {
108- setSelectedTabId ( e . target . value )
107+ const handleSegmentSelectedTabChange = ( selectedSegment ) => {
108+ setSelectedTabId ( selectedSegment . value )
109109 }
110110
111111 return (
@@ -120,19 +120,12 @@ export const FeatureDescriptionModal = ({
120120 tabsConfig . length > 0 && (
121121 < >
122122 < div className = "px-20 pb-8 flex left w-100" >
123- < StyledRadioGroup
124- className = "gui-yaml-switch"
123+ < SegmentedControl
124+ segments = { tabsConfig . map ( ( tab ) => ( { label : tab . title , value : tab . id } ) ) }
125+ value = { selectedTabId }
126+ onChange = { handleSegmentSelectedTabChange }
125127 name = "feature-description-modal-tabs"
126- initialTab = { selectedTab . id }
127- disabled = { false }
128- onChange = { handleSelectedTabChange }
129- >
130- { tabsConfig . map ( ( tab ) => (
131- < StyledRadioGroup . Radio value = { tab . id } key = { tab . id } >
132- { tab . title }
133- </ StyledRadioGroup . Radio >
134- ) ) }
135- </ StyledRadioGroup >
128+ />
136129 </ div >
137130 < FeatureDescriptionModalContent
138131 SVGImage = { selectedTab . SVGImage }
0 commit comments