import { CSSProperties, ReactNode, useState } from 'react'; import axios from 'axios'; import { userInfo } from "../api/api"; import { AccountAvatar } from "./account"; import { Bubble, Vierkant, IconLabelButton } from './ui'; import DoneIcon from '@material-ui/icons/Done'; import CloseIcon from '@material-ui/icons/Close'; export function NotificationsArea(props: { visible?: boolean; friendRequests?: Array; }) { return props.visible &&

Meldingen

{ /* here should be the game invites */ } { props.friendRequests?.map(user => ) }
} var FriendRequestButtonStyle: CSSProperties = { borderRadius: 6, display: "inline-block", marginLeft: 0, textAlign: "center" }; function Acceptable(props: { children?: ReactNode; onAccept?: () => void; onDeny?: () => void; }) { return
{props.children}
} text="Accepteren"/> } text="Verwijderen"/>
} function FriendRequest(props: { user: userInfo; }) { var [ gone, setGone ] = useState(false); return !gone && { axios.request({ method: "post", url: "/api/social/accept", headers: {"content-type": "application/json"}, data: { "id": props.user?.id } }) .then(() => setGone(true)); }} onDeny={() => { axios.request({ method: "post", url: "/api/social/remove", headers: {"content-type": "application/json"}, data: { "id": props.user?.id } }) .then(() => setGone(true)); }}>
Vriendschapsverzoek {props.user.username}
} /* function GameInvite(props: { */ /* game: gameInfo; */ /* }) { */ /* return */ /* */ /*
*/ /* Partijuitnodiging */ /*

{props.game.opponent?.username} wil een potje 4 op een rij spelen!

*/ /*
*/ /* */ /*
*/ /* } */