|
|
@ -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,13 +38,13 @@ const SwitchWithLabel: FC<SwitchWithLabelProps> = ({ |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
|
|
|
|
<> |
|
|
|
<SwitchFormControlLabel |
|
|
|
<SwitchFormControlLabel |
|
|
|
componentsProps={{ typography: { flexGrow: 1 } }} |
|
|
|
componentsProps={{ typography: { flexGrow: 1 } }} |
|
|
|
control={ |
|
|
|
control={ |
|
|
|
<MUISwitch |
|
|
|
<MUISwitch |
|
|
|
checked={isChecked} |
|
|
|
checked={isChecked} |
|
|
|
edge="end" |
|
|
|
edge="end" |
|
|
|
id={switchId} |
|
|
|
|
|
|
|
name={switchName} |
|
|
|
name={switchName} |
|
|
|
onChange={onChange} |
|
|
|
onChange={onChange} |
|
|
|
{...switchProps} |
|
|
|
{...switchProps} |
|
|
@ -53,6 +54,14 @@ const SwitchWithLabel: FC<SwitchWithLabelProps> = ({ |
|
|
|
labelPlacement="start" |
|
|
|
labelPlacement="start" |
|
|
|
{...formControlLabelProps} |
|
|
|
{...formControlLabelProps} |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
<input |
|
|
|
|
|
|
|
checked={isChecked} |
|
|
|
|
|
|
|
hidden |
|
|
|
|
|
|
|
id={switchId} |
|
|
|
|
|
|
|
readOnly |
|
|
|
|
|
|
|
{...baseInputProps} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</> |
|
|
|
); |
|
|
|
); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|