import { createSignal, onMount } from "solid-js";
import { theImager } from "./api"
import "./comps.css"
// warning: this IS horrible code. its a joke. DO NOT try this at home because
// your local senior programmer CAN and WILL hunt you down
// you have been warned.
export function AdvancedBr({ count }: { count: number }) {
    return new Array(count).fill(null).map(_ => (<br />))
}

export function SingularOomfie(props: { name: string, url: string, discordid: string }) {
    const [imageSrc, setImageSrc] = createSignal("");

    onMount(async () => {
      const url = await theImager(props.discordid);
      setImageSrc(url);
    });
  
    return (
      <a href={props.url}>
        <img
          class="tooltip"
          style={{
            "max-width": "3em",
            "border-radius": "30%",
          }}
          src={imageSrc()}
          alt={"profile picture for" + props.name}
        />
      </a>
    );
}