2021-09-19 15:33:48 +00:00
|
|
|
import * as React from "react"
|
|
|
|
import * as ReactDOM from "react-dom"
|
|
|
|
import Style from "./ResearchGroupPanel.module.css"
|
|
|
|
import {Panel, BringAttention as B, Button, Variable} from "@steffo/bluelib-react";
|
|
|
|
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
|
|
|
|
import {faEnvelope, faEye, faGlobe, faQuestion} from "@fortawesome/free-solid-svg-icons";
|
2021-09-19 22:28:02 +00:00
|
|
|
import {Link} from "@reach/router";
|
2021-09-19 15:33:48 +00:00
|
|
|
import {IconDefinition} from "@fortawesome/fontawesome-svg-core";
|
2021-09-19 21:49:16 +00:00
|
|
|
import {ResearchGroup} from "../types";
|
2021-09-19 22:28:02 +00:00
|
|
|
import {UserLink} from "./UserLink";
|
2021-09-19 15:33:48 +00:00
|
|
|
|
|
|
|
|
2021-09-19 21:49:16 +00:00
|
|
|
export function ResearchGroupPanel({owner, name, access, slug}: ResearchGroup): JSX.Element {
|
2021-09-19 15:33:48 +00:00
|
|
|
let accessIcon: IconDefinition
|
|
|
|
if(access === "OPEN") {
|
|
|
|
accessIcon = faGlobe
|
|
|
|
}
|
|
|
|
else if(access === "MANUAL") {
|
|
|
|
accessIcon = faEnvelope
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
accessIcon = faQuestion
|
|
|
|
}
|
|
|
|
|
2021-09-19 22:28:02 +00:00
|
|
|
// FIXME: use proper bluelib Anchors
|
|
|
|
|
2021-09-19 15:33:48 +00:00
|
|
|
return (
|
|
|
|
<Panel className={Style.Panel}>
|
|
|
|
<div className={Style.Access}>
|
|
|
|
<FontAwesomeIcon icon={accessIcon}/>
|
|
|
|
</div>
|
|
|
|
<div className={Style.Name} title={slug}>
|
2021-09-19 22:28:02 +00:00
|
|
|
<Link to={`/g/${slug}/`}>{name}</Link>
|
2021-09-19 15:33:48 +00:00
|
|
|
</div>
|
|
|
|
<div className={Style.Owner}>
|
2021-09-19 22:28:02 +00:00
|
|
|
Created by <UserLink id={owner}/>
|
2021-09-19 15:33:48 +00:00
|
|
|
</div>
|
|
|
|
</Panel>
|
|
|
|
)
|
|
|
|
}
|