import {CogIcon, TrashIcon, UserAddIcon, UsersIcon} from "@heroicons/react/outline"; import Dropdown from "../ui/Dropdown"; import {useState} from "react"; export default function TeamListItem(props) { const [ team, setTeam ] = useState(props.team); const acceptInvite = () => invitationResponse(true); const declineInvite = () => invitationResponse(false); const invitationResponse = (accept: boolean) => fetch('/api/user/membership', { method: accept ? 'PATCH' : 'DELETE', body: JSON.stringify({ teamId: props.team.id }), headers: { 'Content-Type': 'application/json' } }).then( () => { // success setTeam(null); }); return (team &&
  • {props.team.name} {props.team.role.toLowerCase()}
    {props.team.role === 'INVITEE' &&
    } {props.team.role === 'MEMBER' &&
    } {props.team.role === 'OWNER' &&
    }
    {/*{props.team.userRole === 'Owner' && expanded &&
    {props.team.members.length > 0 &&

    Members

    {props.team.members.map( (member) => )}
    Alex van Andel ({ member.email }) Owner
    }
    }*/}
  • ); }