validated otp input to be numbers

This commit is contained in:
victorAnumudu
2024-04-16 20:17:57 +01:00
parent f95fd66c57
commit 886fd64347
2 changed files with 130 additions and 73 deletions
+3
View File
@@ -23,6 +23,7 @@ export interface InputCompOneProps {
parentSelectClass?: string;
parentClass?: string;
maxLength?: number;
error?: string;
}
const InputCompOne = forwardRef<HTMLInputElement, InputCompOneProps>(
@@ -49,6 +50,7 @@ const InputCompOne = forwardRef<HTMLInputElement, InputCompOneProps>(
parentSelectClass,
parentClass,
maxLength,
error,
},
forwardedRef
) => {
@@ -58,6 +60,7 @@ const InputCompOne = forwardRef<HTMLInputElement, InputCompOneProps>(
<label htmlFor="" className={labelClass}>
{label}
{labelSpan && <span className={labelSpanClass}>{labelSpan}</span>}
{error && <span className='text-[10px] text-red-500'>{error}</span>}
</label>
)}
{input && (