import React, { ComponentPropsWithoutRef, ElementRef, forwardRef } from "react"

export type FormProps = Omit<ComponentPropsWithoutRef<"form">, "className">

/**
 * A simple Form wrapper that doesn't affect the layout of its children.
 */
export const Form = forwardRef<ElementRef<"form">, FormProps>(function Form(
  { children, ...rest },
  ref,
) {
  return (
    <form className="contents" {...rest} ref={ref}>
      {children}
    </form>
  )
})
