import { createSignal } from 'solid-js' import { createStyles } from '../styles/use-styles' interface InputProps { label?: string type?: 'text' | 'number' | 'password' | 'email' value?: string placeholder?: string onChange?: (value: string) => void description?: string } export function Input(props: InputProps) { const styles = createStyles() const [val, setVal] = createSignal(props.value || '') const handleChange = (e: Event) => { const value = (e.target as HTMLInputElement).value setVal((prev) => (prev !== value ? value : prev)) props.onChange?.(value) } return (
{props.label && ( )} {props.description && (

{props.description}

)}
) }