2021-08-29 18:42:35 +00:00
|
|
|
import * as React from "react"
|
|
|
|
import {IconDefinition} from "@fortawesome/free-regular-svg-icons";
|
|
|
|
import {Panel, Anchor} from "@steffo/bluelib-react";
|
|
|
|
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
|
|
|
|
import Style from "./Account.module.css"
|
|
|
|
|
|
|
|
|
|
|
|
interface AccountProps {
|
|
|
|
icon: IconDefinition,
|
|
|
|
url: string,
|
|
|
|
name: string,
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function Account({icon, url, name}: AccountProps): JSX.Element {
|
|
|
|
let contents: JSX.Element
|
|
|
|
if(url) {
|
|
|
|
contents = <Anchor href={url}><FontAwesomeIcon icon={icon}/> {name}</Anchor>
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
contents = <><FontAwesomeIcon icon={icon}/> {name}</>
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
2021-10-25 11:41:34 +00:00
|
|
|
<Panel className={Style.Account} style={{minWidth: "unset"}}>
|
2021-08-29 18:42:35 +00:00
|
|
|
{contents}
|
|
|
|
</Panel>
|
|
|
|
)
|
|
|
|
}
|