lint everything

This commit is contained in:
2023-11-18 16:34:09 +01:00
parent 68e5977fb2
commit 1af65eb479
78 changed files with 2282 additions and 2258 deletions

View File

@@ -3,28 +3,28 @@ import { Control, FieldPath, FieldValues, useController } from 'react-hook-form'
import { RadioGroup, RadioGroupProps } from '@/components/ui'
export type ControlledRadioGroupProps<TFieldValues extends FieldValues> = {
control: Control<TFieldValues>
name: FieldPath<TFieldValues>
control: Control<TFieldValues>
name: FieldPath<TFieldValues>
} & Omit<RadioGroupProps, 'id' | 'onChange' | 'value'>
export const ControlledRadioGroup = <TFieldValues extends FieldValues>(
props: ControlledRadioGroupProps<TFieldValues>
props: ControlledRadioGroupProps<TFieldValues>
) => {
const {
field: { onChange, ...field },
fieldState: { error },
} = useController({
control: props.control,
name: props.name,
})
const {
field: { onChange, ...field },
fieldState: { error },
} = useController({
control: props.control,
name: props.name,
})
return (
<RadioGroup
{...props}
{...field}
errorMessage={error?.message}
id={props.name}
onValueChange={onChange}
/>
)
return (
<RadioGroup
{...props}
{...field}
errorMessage={error?.message}
id={props.name}
onValueChange={onChange}
/>
)
}