Microsoft Teams was released in 2017, and it took about three years to get an API that makes it possible to get user online presence status. We had to use a workaround. But as for today, we have the REST API method to get user presence information{target=_blank}.
git clone https://github.com/vzhukov/spfx-teams-presence.git
npm install
gulp serve --nobrowserOpen your SharePoint Online workbench at:
https://[tenant].sharepoint.com/_layouts/15/workbench.aspx
and add the web part to the page.
Original blog post: https://blog.vitalyzhukov.ru/en/spfx-teams-presence-status-microsoft-graph