@@ -5,6 +5,7 @@ import { faCircleDot } from "@fortawesome/free-solid-svg-icons";
55import { ReactElement , useState } from "react" ;
66import { faCircle } from "@fortawesome/free-regular-svg-icons" ;
77import { ActionProps } from "../Actions" ;
8+ import { useClassNames } from "../../../hooks" ;
89
910export interface RadioActionProps extends ActionProps {
1011 options : {
@@ -17,13 +18,13 @@ export interface RadioActionProps extends ActionProps {
1718export function RadioAction ( { actionId, options, initialIndex, onTrigger } : RadioActionProps ) : ReactElement {
1819 const [ activeIndex , setActiveIndex ] = useState ( initialIndex ?? 0 ) ;
1920
20- return ( < div key = { actionId } >
21+ return < div key = { actionId } className = { useClassNames ( [ ] , "Actions" , "Radio" ) } >
2122 { options . map ( ( { label, shortcut } , index ) =>
2223 < button key = { label } className = { styles . Button } tabIndex = { 0 } onClick = { ( event ) => {
2324 setActiveIndex ( index ) ;
2425 onTrigger ?.( event as unknown as Event , index ) ;
2526 } } >
26- < span className = { styles . Label } >
27+ < span className = { useClassNames ( [ styles . Label ] , "Actions" , "Label" ) } >
2728 < div className = { styles . Icon } >
2829 { activeIndex === index
2930 ? < FontAwesomeIcon icon = { faCircleDot } />
@@ -35,5 +36,5 @@ export function RadioAction({ actionId, options, initialIndex, onTrigger }: Radi
3536 { shortcut && < p className = { styles . Shortcut } > { formatShortcut ( shortcut ) } </ p > }
3637 </ button >
3738 ) }
38- </ div > ) ;
39+ </ div > ;
3940}
0 commit comments