UNPKG

@selfcommunity/react-ui

Version:

React UI Components to integrate a Community created with SelfCommunity Platform.

30 lines (29 loc) 903 B
'use client'; import { jsx as _jsx } from "react/jsx-runtime"; import { useIsRecording } from '@livekit/components-react'; import { useEffect, useState } from 'react'; /** * RecordingIndicator * @alpha */ export default function RecordingIndicator() { const isRecording = useIsRecording(); const [wasRecording, setWasRecording] = useState(false); useEffect(() => { if (isRecording !== wasRecording) { setWasRecording(isRecording); if (isRecording) { window.alert('This meeting is being recorded'); } } }, [isRecording]); return (_jsx("div", { style: { position: 'absolute', top: '0', left: '0', width: '100%', height: '100%', boxShadow: isRecording ? 'red 0px 0px 0px 3px inset' : 'none', pointerEvents: 'none' } })); }