import React from "react"; import { ColorInput, ColorInputProps } from "@mantine/core"; import { useController, FieldValues, UseControllerProps, } from "react-hook-form"; type Props = ColorInputProps & { name: UseControllerProps["name"]; rules?: UseControllerProps["rules"]; defaultValue?: UseControllerProps["defaultValue"]; }; function RHFColorInput(props: Props) { const { name, rules, defaultValue, ...others } = props; const { field, fieldState: { error }, } = useController({ name, rules }); return ( ); } export default RHFColorInput; export const createColorInputField = () => { const Field = (props: Props) => ; return Field; };