diff --git a/src/renderer/components/switch/form-switcher.tsx b/src/renderer/components/switch/form-switcher.tsx index a8ae022666..d2a069a771 100644 --- a/src/renderer/components/switch/form-switcher.tsx +++ b/src/renderer/components/switch/form-switcher.tsx @@ -4,14 +4,18 @@ */ import React from "react"; -import type { FormControlLabelProps } from "@material-ui/core/FormControlLabel"; + +interface FormControlLabelProps { + control: React.ReactElement; + label: React.ReactNode; +} /** * @deprecated Use instead from "../switch.tsx". */ export function FormSwitch(props: FormControlLabelProps & { children?: React.ReactNode }) { const ClonedElement = React.cloneElement(props.control, { - children: props.label, + children: {props.label}, }); return ClonedElement; diff --git a/src/renderer/components/switch/switcher.tsx b/src/renderer/components/switch/switcher.tsx index 39f3b7eb13..e30e63ccf5 100644 --- a/src/renderer/components/switch/switcher.tsx +++ b/src/renderer/components/switch/switcher.tsx @@ -4,22 +4,20 @@ */ import React from "react"; -import type { SwitchClassKey, SwitchProps } from "@material-ui/core/Switch"; import { Switch } from "./switch"; -interface Styles extends Partial> { - focusVisible?: string; -} - -export interface SwitcherProps extends SwitchProps { - classes: Styles; +export interface SwitcherProps { + disabled?: boolean; children?: React.ReactNode; + checked?: boolean; + onChange?: (event: React.ChangeEvent, checked: boolean) => void; + name?: string; } /** * @deprecated Use instead from "../switch.tsx". */ -export const Switcher = () => (({ disabled, checked, onChange, name, children }: SwitcherProps) => { +export function Switcher({ disabled, checked, onChange, name, children }: SwitcherProps) { return ( (({ disabled, checked, onChange, name, children } {children} ); -}); +}