You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
575 B
28 lines
575 B
import { Switch } from "../UI/Switch.js";
|
|
import { InfoWrapper } from "./InfoWrapper.js";
|
|
|
|
export interface ToggleProps {
|
|
checked: boolean;
|
|
label?: string;
|
|
description?: string;
|
|
disabled?: boolean;
|
|
onChange?: (checked: boolean) => void;
|
|
}
|
|
|
|
export const Toggle = ({
|
|
checked,
|
|
label,
|
|
description,
|
|
disabled,
|
|
onChange
|
|
}: ToggleProps): JSX.Element => {
|
|
return (
|
|
<InfoWrapper label={label} description={description}>
|
|
<Switch
|
|
checked={checked}
|
|
disabled={disabled}
|
|
onCheckedChange={onChange}
|
|
/>
|
|
</InfoWrapper>
|
|
);
|
|
};
|
|
|