// Call entry point for the Conversations app.
//
// The call UI itself lives outside React, in app/call-experience.js — the
// sticky bar, the full-screen workspace and the wrap-up all need to sit over
// the whole product, not just this pane, so Call Logs and the call-detail
// sheet can start a call on exactly the same surface.
//
// What stays here is the doorway: every "call this person" control in the
// Conversations app already calls window.startCall(thread), so that keeps
// working and the event is what crosses the boundary.
//
// This replaced a self-contained floating call card that only existed inside
// Conversations. If you are looking for that, it is in the history.

const startCall = (thread) => {
  window.dispatchEvent(new CustomEvent("convo:call", { detail: { thread } }));
};
window.startCall = startCall;

// Kept so convo-app.jsx can go on mounting <CallWidget /> without caring that
// the widget now renders nothing.
const CallWidget = () => null;

window.CallWidget = CallWidget;
window.startCall = startCall;
