Files
persian-ping-frontend/src/components/input/index.tsx
2024-06-16 01:25:20 +04:30

36 lines
714 B
TypeScript

import { InputProps } from "../../types/props";
const Input = ({
label,
id,
type,
name,
placeholder,
labelStyle,
extra,
...attrs
}: InputProps) => {
return (
<div>
{label && (
<label
htmlFor={id}
className={`block mb-2 text-sm font-medium text-white ${labelStyle}`}
>
{label}
</label>
)}
<input
type={type}
name={name}
id={id}
className={`outline-none border-none sm:text-sm rounded-lg block w-full p-2.5 md:p-3 bg-gray-700 border-gray-600 placeholder-gray-400 text-white ${extra}`}
placeholder={placeholder}
{...attrs}
/>
</div>
);
};
export default Input;