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