import { type HTMLInputTypeAttribute, useState } from "react"; import { type UseFormRegisterReturn, type InternalFieldName, } from "react-hook-form"; /** * Single line input for the fields found to the right of the * resource logo. */ function InfoInputLine({ value, placeholder, hint, details, }: { value: string; placeholder: string; hint?: string; details: UseFormRegisterReturn; }) { const [curValue, setCurValue] = useState(value); return (
{ setCurValue(event.target.value); details.onChange(event).catch((e) => { console.error(e); }); }} placeholder={placeholder} type="text" className="w-full border-b border-neutral-300 px-2" />
); } function GenericInput({ label, placeholder, type = "text", details, }: { label: string; placeholder?: string; type: HTMLInputTypeAttribute; details: UseFormRegisterReturn; }) { return (
); } export { InfoInputLine, GenericInput };