UNPKG

@state-less/leap-frontend

Version:

A collection of open source fullstack services powered by React Server

12 lines (11 loc) 598 B
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useServerState } from '@state-less/react-client'; import { Box, Tooltip } from '@mui/material'; import { Sensors } from '@mui/icons-material'; export const ConnectionCounter = () => { const [connections, _, { loading }] = useServerState(0, { key: 'connections', scope: 'global', }); return (_jsx(Tooltip, { title: "Connections", placement: "bottom", children: _jsxs(Box, { sx: { display: 'flex', alignItems: 'center', mr: 1 }, children: [_jsx(Sensors, {}), loading ? '-' : connections] }) })); };