refactor(web): remove typescript

This commit is contained in:
Ali BARIN
2024-02-27 15:23:23 +00:00
parent 636870a075
commit b3ae2d2748
337 changed files with 2067 additions and 4997 deletions

View File

@@ -1,20 +1,10 @@
import * as React from 'react';
import { Controller, useFormContext } from 'react-hook-form';
import FormControlLabel, {
FormControlLabelProps,
} from '@mui/material/FormControlLabel';
import MuiSwitch, { SwitchProps as MuiSwitchProps } from '@mui/material/Switch';
type SwitchProps = {
name: string;
label: string;
shouldUnregister?: boolean;
FormControlLabelProps?: Partial<FormControlLabelProps>;
} & MuiSwitchProps;
export default function Switch(props: SwitchProps): React.ReactElement {
import FormControlLabel from '@mui/material/FormControlLabel';
import MuiSwitch from '@mui/material/Switch';
export default function Switch(props) {
const { control } = useFormContext();
const inputRef = React.useRef<HTMLInputElement | null>(null);
const inputRef = React.useRef(null);
const {
required,
name,
@@ -28,7 +18,6 @@ export default function Switch(props: SwitchProps): React.ReactElement {
className,
...switchProps
} = props;
return (
<Controller
rules={{ required }}