feat: spread input props

This commit is contained in:
2025-05-21 19:26:54 +02:00
parent aee3306c2b
commit 07e1cbc66f

View File

@ -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 || ""
}`} }`}
/> />