Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

1022 B
Raw Blame
import { forwardRef, type ElementRef, type ComponentProps } from "react";

// This module serves only the deprecated Webhook Form. Remove its private Props with it.
type Props = ComponentProps<"form"> & {
  encType?:
    | "application/x-www-form-urlencoded"
    | "multipart/form-data"
    | "text/plain";
  /** Use this property to reveal the Success and Error states on the canvas so they can be styled. The Initial state is displayed when the page first opens. The Success and Error states are displayed depending on whether the Form submits successfully or unsuccessfully. */
  state?: "initial" | "success" | "error";
  onStateChange: (state: "initial" | "success" | "error") => void;
};

/** @deprecated Webhook Form is supported through the next release. Use Form for new forms. */
export const WebhookForm = forwardRef<ElementRef<"form">, Props>(
  ({ children, state = "initial", ...props }, ref) => (
    <form {...props} ref={ref}>
      {children}
    </form>
  )
);

WebhookForm.displayName = "WebhookForm";