{"size": 1731, "ext": "js", "max_stars_repo_path": "src/components/Urbit/Avatar.js", "max_stars_repo_name": "dcSpark/urbit-dashboard", "max_stars_repo_stars_event_min_datetime": "2021-10-01T17:14:24.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-21T17:46:07.000Z", "max_issues_repo_path": "src/components/Urbit/Avatar.js", "max_issues_repo_name": "dcSpark/urbit-dashboard", "max_issues_repo_issues_event_min_datetime": "2021-10-20T09:15:19.000Z", "max_issues_repo_issues_event_max_datetime": "2021-12-30T12:59:39.000Z", "max_forks_repo_path": "src/components/Urbit/Avatar.js", "max_forks_repo_name": "dcSpark/urbit-dashboard", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 8, "max_issues_count": 7, "max_forks_count": null, "avg_line_length": 46.7837837838, "max_line_length": 496, "alphanum_fraction": 0.6799537839}
import * as React from "react";
import { useState, useEffect } from "react";
import Sigil from "./Sigil";
import {useStore} from "../../store";

export default function Avatar(props) {
  const {activeShip, loading} = useStore();
  return(
    <div className="avatar-wrapper">
      {loading && <Spinner width="50" innerColor="white" outerColor="black" />}
      <div className="uv-avatar">
      <Sigil patp={activeShip} size={40} />
       <p>~{activeShip}</p>
      </div>
      </div>
    )
}



// interface SpinnerProps{
//   width: string,
//   outerColor: string,
//   innerColor: string
// }
function Spinner(props){

  return(
  <div className="spinner">
  <svg width={props.width} height={props.width} viewBox="0 0 16 16">
    <path fill={props.innerColor} fillRule="evenodd" clipRule="evenodd" d="M8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16ZM8 12C10.2091 12 12 10.2091 12 8C12 5.79086 10.2091 4 8 4C5.79086 4 4 5.79086 4 8C4 10.2091 5.79086 12 8 12Z"></path>
    <path  fill={props.outerColor} d="M12.4446 1.34824C11.129 0.469192 9.58225 0 8 0L8 4C10.2091 4 12 5.79086 12 8C12 10.2091 10.2091 12 8 12C5.79086 12 4 10.2091 4 8L0 8C0 9.58225 0.469191 11.129 1.34824 12.4446C2.22729 13.7602 3.47672 14.7855 4.93853 15.391C6.40034 15.9965 8.00887 16.155 9.56072 15.8463C11.1126 15.5376 12.538 14.7757 13.6569 13.6569C14.7757 12.538 15.5376 11.1126 15.8463 9.56072C16.155 8.00888 15.9965 6.40034 15.391 4.93853C14.7855 3.47672 13.7602 2.2273 12.4446 1.34824Z">
      <animateTransform attributeName="transform" attributeType="XML" type="rotate" from="0 8 8" to="360 8 8" dur="1.5s" repeatCount="indefinite"></animateTransform>
    </path>
  </svg>
  </div>
  )}