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 {
|
||||
id: string;
|
||||
type: string;
|
||||
placeholder?: string;
|
||||
className?: string;
|
||||
}
|
||||
type InputProps = InputHTMLAttributes<HTMLInputElement>;
|
||||
|
||||
export const Input: FC<InputProps> = ({ id, type, placeholder, className }) => {
|
||||
export const Input: FC<InputProps> = ({ className, ...props }) => {
|
||||
return (
|
||||
<input
|
||||
id={id}
|
||||
type={type}
|
||||
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 ${
|
||||
{...props}
|
||||
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 ${
|
||||
className || ""
|
||||
}`}
|
||||
/>
|
||||
|
Reference in New Issue
Block a user