import { cn } from "~/lib/utils"; import type { JSX } from "solid-js"; interface InputProps { label?: string; type?: "text" | "email" | "password" | "number"; value?: string; onInput?: (e: InputEvent & { currentTarget: HTMLInputElement }) => void; error?: string; helperText?: string; placeholder?: string; class?: string; id?: string; name?: string; required?: boolean; disabled?: boolean; } export default function Input(props: InputProps) { const id = () => props.id ?? props.name ?? globalThis.crypto?.randomUUID?.() ?? Math.random().toString(36).slice(2, 10); return (
{props.label && ( )} {props.error && (

{props.error}

)} {props.helperText && !props.error && (

{props.helperText}

)}
); }