import React from 'react';
import { Input } from '@cloudflare/component-input';
import { Base, BaseProps } from './Base';

export type InputProps<FieldType> = BaseProps<
  Omit<React.ComponentProps<typeof Input>, 'placeholder'>,
  FieldType
>;

export default function FormInput<FieldType>({
  ...props
}: InputProps<FieldType>) {
  return (
    <Base<InputProps<FieldType>, FieldType>
      // @ts-ignore
      Component={Input}
      {...props}
    />
  );
}
