diff --git a/striker-ui/components/ManageFence/CommonFenceInputGroup.tsx b/striker-ui/components/ManageFence/CommonFenceInputGroup.tsx index 9c70146e..cccfee64 100644 --- a/striker-ui/components/ManageFence/CommonFenceInputGroup.tsx +++ b/striker-ui/components/ManageFence/CommonFenceInputGroup.tsx @@ -24,7 +24,6 @@ const MAP_TO_INPUT_BUILDER: MapToInputBuilder = { input={ = ({ checked: isChecked, - flexBoxProps: { sx: flexBoxSx, ...restFlexBoxProps } = {}, + formControlLabelProps, id: switchId, label, name: switchName, onChange, switchProps, }) => { - const combinedFlexBoxSx = useMemo>( - () => ({ - '& > :first-child': { - flexGrow: 1, - }, - - ...flexBoxSx, - }), - [flexBoxSx], - ); - - const labelElement = useMemo( + const labelElement = useMemo( () => typeof label === 'string' ? ( - + {label} ) : ( - label + <>{label} ), [label], ); return ( - - {labelElement} - - + + } + label={labelElement} + labelPlacement="start" + {...formControlLabelProps} + /> ); }; diff --git a/striker-ui/types/SwitchWithLabel.d.ts b/striker-ui/types/SwitchWithLabel.d.ts index 4015119c..4e4448bf 100644 --- a/striker-ui/types/SwitchWithLabel.d.ts +++ b/striker-ui/types/SwitchWithLabel.d.ts @@ -1,5 +1,5 @@ type SwitchWithLabelOptionalProps = { - flexBoxProps?: import('../components/FlexBox').FlexBoxProps; + formControlLabelProps?: import('@mui/material').FormControlLabelProps; switchProps?: import('@mui/material').SwitchProps; };