import React, { useState, useEffect } from "react";
import { Spin } from "antd";
import _service from "@netuno/service-client";

import './index.less';

function OtherAstros({aroundAstroUid}) {
  const servicePrefix = _service.config().prefix;
  const [list, setList] = useState([]);
  const [loading, setLoading] = useState(true);
      
  /*
  useEffect( () => {
    setLoading(true);
    _service({
      url: "/astro/list",
      data: {aroundAstroUid},
      success: (response) => {
        setList([response.json]);
        setLoading(false);
      },
      fail: (e) => {
        console.error("Service Error", e);
        notification.error({
          message:"Erro",
          description:"Não foi possível encontrar o astro."
        });
        setLoading(false);
      },
    });
  }, []);
  */
  /*
  if( loading ){
    return( <Spin size="large"/> );
  }
  */
  //if( list.length > 0 ){ 
    return ( <>
      <h1>Astros na sua orbita:</h1>
      <div className="other-astros-list">
        <ul>
          <li>Outros astros...</li>
        </ul>
      </div>
    </>);
  //}
}

export default OtherAstros;