first commit

This commit is contained in:
2023-10-12 18:29:47 +05:00
commit 826ac1f621
64 changed files with 5159 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
import { useEffect, useState } from "react";
interface InputProps {
type?: "text" | "email" | "password";
placeholder?: string;
autoFocus?: boolean;
required?: boolean;
handleChange?: (value: string) => void;
}
function Input({
type = "text",
placeholder,
autoFocus,
required,
handleChange,
}: InputProps) {
const [value, setValue] = useState<string>("");
useEffect(() => {
if (handleChange) {
handleChange(value);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [value]);
return (
<input
type={type}
placeholder={placeholder}
autoFocus={autoFocus}
required={required}
value={value}
onChange={(e) => setValue(e.target.value)}
className="px-3 py-2.5 outline-none rounded-lg border border-[#DAE0E5]"
/>
);
}
export default Input;