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); props.onChange(); }); return (team &&
Alex van Andel ({ member.email }) | Owner |