import * as React from 'react';

// type property is omitted because here in order to reduce its range to only `text`
interface TextFieldProps extends Omit<React.ComponentProps<'input'>, 'type'> {}

export const TextField = React.forwardRef<HTMLInputElement, TextFieldProps>(
  ({ className, placeholder = '', autoComplete, value, ...inputProps }, ref) => {
    return (
      <input
        {...inputProps}
        placeholder={placeholder}
        ref={ref}
        autoComplete={autoComplete}
        className={className}
        value={value}
      />
    );
  }
);

TextField.displayName = 'TextField';
