import { h, VNode } from "preact"; import { useLayoutEffect, useRef, useState } from "preact/hooks"; export interface TextInputProps { inputType?: "text" | "number" | "multiline" | "password"; label: string; grabFocus?: boolean; disabled?: boolean; error?: string; placeholder?: string; tooltip?: string; onConfirm?: () => void; bind: [string, (x: string) => void]; } const TextInputType = function ({ inputType, grabFocus, ...rest }: any): VNode { const inputRef = useRef(null); useLayoutEffect(() => { if (grabFocus) { inputRef.current?.focus(); } }, [grabFocus]); return inputType === "multiline" ? (