refactor(web): remove typescript
This commit is contained in:
@@ -1,16 +1,7 @@
|
||||
import * as React from 'react';
|
||||
import { Controller, useFormContext } from 'react-hook-form';
|
||||
import Checkbox, { CheckboxProps } from '@mui/material/Checkbox';
|
||||
|
||||
type ControlledCheckboxProps = {
|
||||
name: string;
|
||||
defaultValue?: boolean;
|
||||
dataTest?: string;
|
||||
} & Omit<CheckboxProps, 'defaultValue'>;
|
||||
|
||||
export default function ControlledCheckbox(
|
||||
props: ControlledCheckboxProps
|
||||
): React.ReactElement {
|
||||
import Checkbox from '@mui/material/Checkbox';
|
||||
export default function ControlledCheckbox(props) {
|
||||
const { control } = useFormContext();
|
||||
const {
|
||||
required,
|
||||
@@ -22,7 +13,6 @@ export default function ControlledCheckbox(
|
||||
dataTest,
|
||||
...checkboxProps
|
||||
} = props;
|
||||
|
||||
return (
|
||||
<Controller
|
||||
rules={{ required }}
|
Reference in New Issue
Block a user