MCPcopy Create free account
hub / github.com/Open-Dev-Society/OpenStock / InputField

Function InputField

components/forms/InputField.tsx:6–24  ·  view source on GitHub ↗
({name, label, placeholder, type ="text", register, error, validation, disabled, value}: FormInputProps)

Source from the content-addressed store, hash-verified

4import {cn} from "@/lib/utils";
5
6const InputField = ({name, label, placeholder, type ="text", register, error, validation, disabled, value}: FormInputProps) => {
7 return (
8 <div className="space-y-2">
9 <Label htmlFor={name} className="form-label">
10 {label}
11 </Label>
12 <Input
13 type={type}
14 id={name}
15 placeholder={placeholder}
16 disabled={disabled}
17 value={value}
18 className={cn('form-input', {'opacity-50 cursor-not-allowed': disabled})}
19 {...register(name, validation)}
20 />
21 {error && <p className="text-red-500">{error.message}</p>}
22 </div>
23 )
24}
25export default InputField

Callers

nothing calls this directly

Calls 1

cnFunction · 0.90

Tested by

no test coverage detected