import {faEnvelope, faGlobe} from "@fortawesome/free-solid-svg-icons" import {FontAwesomeIcon} from "@fortawesome/react-fontawesome" import * as React from "react" import {ManagedResource} from "../../hooks/useManagedViewSet" import {SophonResearchGroup} from "../../types/SophonTypes" import {Link} from "../elements/Link" import {ResourcePanel} from "../elements/ResourcePanel" import {GroupJoinButton} from "./GroupJoinButton" import {GroupLeaveButton} from "./GroupLeaveButton" export interface GroupResourcePanelProps { resource: ManagedResource, } export function GroupResourcePanel({resource}: GroupResourcePanelProps): JSX.Element { const icon = resource.value.access === "OPEN" ? faGlobe : faEnvelope const trueMembers = [resource.value.owner, ...resource.value.members] return ( {resource.value.name} {trueMembers.length} member{trueMembers.length !== 1 ? "s" : ""} ) }