import { Select, type SelectProps } from "@mantine/core"; import { type FieldValues, type UseControllerProps, useController } from "react-hook-form"; export type MantineSelectProps = UseControllerProps & Omit; // @todo: change is not triggered correctly export function MantineSelect({ name, control, defaultValue, rules, shouldUnregister, onChange, ...props }: MantineSelectProps) { const { field: { value, onChange: fieldOnChange, ...field }, fieldState, } = useController({ name, control, defaultValue, rules, shouldUnregister, }); return (