Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

901 B
Raw Blame
import type { ComponentProps } from 'solid-js';
import { createEmailComposeContext } from './compose-adapter';
import { createComposeRouteHost } from './compose-host-adapter';
import { createComposeRouteDraft } from './compose-route-draft';
import { EmailComposeView } from './views/email-compose';
export function EmailCompose(
  props: Omit<ComponentProps<typeof EmailComposeView>, 'context' | 'host'>
) {
  const composeContext = createEmailComposeContext();
  const route = createComposeRouteDraft();
  const host = createComposeRouteHost(route);
  // History keeps the params this route opened with; a moved draft lives on
  // only in the URL.
  const draftId = route.draftId() ?? props.draftId;
  return (
    <EmailComposeView
      {...props}
      draftId={draftId}
      initialTo={props.initialTo ?? route.linkedRecipients()}
      context={composeContext}
      host={host}
    />
  );
}