|
|
@ -16,6 +16,7 @@ const SwitchFormControlLabel = styled(MUIFormControlLabel)({ |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const SwitchWithLabel: FC<SwitchWithLabelProps> = ({ |
|
|
|
const SwitchWithLabel: FC<SwitchWithLabelProps> = ({ |
|
|
|
|
|
|
|
baseInputProps, |
|
|
|
checked: isChecked, |
|
|
|
checked: isChecked, |
|
|
|
formControlLabelProps, |
|
|
|
formControlLabelProps, |
|
|
|
id: switchId, |
|
|
|
id: switchId, |
|
|
@ -37,22 +38,30 @@ const SwitchWithLabel: FC<SwitchWithLabelProps> = ({ |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<SwitchFormControlLabel |
|
|
|
<> |
|
|
|
componentsProps={{ typography: { flexGrow: 1 } }} |
|
|
|
<SwitchFormControlLabel |
|
|
|
control={ |
|
|
|
componentsProps={{ typography: { flexGrow: 1 } }} |
|
|
|
<MUISwitch |
|
|
|
control={ |
|
|
|
checked={isChecked} |
|
|
|
<MUISwitch |
|
|
|
edge="end" |
|
|
|
checked={isChecked} |
|
|
|
id={switchId} |
|
|
|
edge="end" |
|
|
|
name={switchName} |
|
|
|
name={switchName} |
|
|
|
onChange={onChange} |
|
|
|
onChange={onChange} |
|
|
|
{...switchProps} |
|
|
|
{...switchProps} |
|
|
|
/> |
|
|
|
/> |
|
|
|
} |
|
|
|
} |
|
|
|
label={labelElement} |
|
|
|
label={labelElement} |
|
|
|
labelPlacement="start" |
|
|
|
labelPlacement="start" |
|
|
|
{...formControlLabelProps} |
|
|
|
{...formControlLabelProps} |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
<input |
|
|
|
|
|
|
|
checked={isChecked} |
|
|
|
|
|
|
|
hidden |
|
|
|
|
|
|
|
id={switchId} |
|
|
|
|
|
|
|
readOnly |
|
|
|
|
|
|
|
{...baseInputProps} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</> |
|
|
|
); |
|
|
|
); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|