feat: spread input props
This commit is contained in:
@ -1,19 +1,12 @@
|
|||||||
import type { FC } from "react";
|
import type { FC, InputHTMLAttributes } from "react";
|
||||||
|
|
||||||
interface InputProps {
|
type InputProps = InputHTMLAttributes<HTMLInputElement>;
|
||||||
id: string;
|
|
||||||
type: string;
|
|
||||||
placeholder?: string;
|
|
||||||
className?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const Input: FC<InputProps> = ({ id, type, placeholder, className }) => {
|
export const Input: FC<InputProps> = ({ className, ...props }) => {
|
||||||
return (
|
return (
|
||||||
<input
|
<input
|
||||||
id={id}
|
{...props}
|
||||||
type={type}
|
className={`w-full border border-gray-300 rounded-md px-3 py-3 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 ${
|
||||||
placeholder={placeholder}
|
|
||||||
className={`w-full border border-gray-300 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 ${
|
|
||||||
className || ""
|
className || ""
|
||||||
}`}
|
}`}
|
||||||
/>
|
/>
|
||||||
|
Reference in New Issue
Block a user