"use client"; // The CRM Inbox, rendered by @insignia/iios-messaging-ui instead of the bespoke in-CRM inbox. // Live = the be-crm data door (CrmInboxAdapter over crm.inbox.* + crm.mail.*); demo = the SDK's // MockInboxAdapter. import { useMemo } from "react"; import { useAppShell } from "@abe-kap/appshell-sdk/react"; import { InboxProvider, Inbox as SdkInbox, type InboxAdapter } from "@insignia/iios-messaging-ui"; import { MockInboxAdapter } from "@insignia/iios-messaging-ui/adapters/mock-inbox"; import "@insignia/iios-messaging-ui/styles.css"; import { isShellConfigured } from "@/lib/appshell"; import { CrmInboxAdapter } from "@/lib/crm-inbox-adapter"; import type { DataDoor } from "@/lib/crm-messaging-adapter"; const SHELL = isShellConfigured(); export function InboxSdk() { return (
{!SHELL && (
Demo mode — running on the SDK's mock inbox adapter.
)}
{SHELL ? : }
); } function DemoInbox() { const adapter = useMemo(() => new MockInboxAdapter(), []); return ( ); } function LiveInbox() { const { sdk } = useAppShell(); const adapter = useMemo(() => new CrmInboxAdapter(sdk as unknown as DataDoor), [sdk]); return ( ); }