import { useUserLoginMutation, CurrentUserDocument } from "../../gql";
import { TextInput } from "../../form";

const initialValues = {
  email: "tomislav.cvetic@u-blox.com",
  password: "1234"
};

const LoginForm = () => {
  const [login, { loading, error, data }] = useUserLoginMutation();
  console.log("LoginForm", loading, error, data);

  return (
    <form>
      <TextInput label="Email" name="email" type="text" placeholder="Email" />
      <TextInput label="Password" name="password" type="password" />
      <button type="submit" disabled={loading}>
        Login!
      </button>
      {error && <div className="error">{error.message}</div>}
    </form>
  );
};

export default LoginForm;
