import React from "react"
import Button from "../button"
import { useFormContext } from "../../hooks/use-form"

function SubmitButton(props) {
  const form = useFormContext()

  return (
    <Button
      is="primary"
      type="submit"
      disabled={form.status === "loading"}
      {...props}
    />
  )
}

export default SubmitButton
