Skip to content

Commit

Permalink
feat: Switch Loading State (#3362)
Browse files Browse the repository at this point in the history
  • Loading branch information
xoscar committed Nov 15, 2023
1 parent 5103746 commit 872ac43
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -9,12 +9,13 @@ interface IProps {
id: string;
disabled?: boolean;
help?: string;
isLoading?: boolean;
onChange?(value: boolean): void;
}

const SwitchControl = ({value = false, onChange = noop, text, id, disabled, help}: IProps) => (
const SwitchControl = ({value = false, isLoading = false, onChange = noop, text, id, disabled, help}: IProps) => (
<S.SwitchContainer>
<Switch onChange={onChange} checked={value} id={id} disabled={disabled} />
<Switch loading={isLoading} onChange={onChange} checked={value} id={id} disabled={disabled} />
<S.SwitchLabel htmlFor={id} $disabled={disabled}>
{text}
</S.SwitchLabel>
Expand Down

0 comments on commit 872ac43

Please sign in to comment.