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.

587 B
Raw Blame
import { useEmailView } from './email-view-context';
import { useEmailTabAvailability } from './tab-availability';
import type { EmailTab } from './types';

/**
 * Whether a tab shows in Email's navigation. Flag-gated tabs show once their
 * flags are on, or while they load with that tab already open.
 */
export function useVisibleEmailTab(): (id: EmailTab) => boolean {
  const { state } = useEmailView();
  const availability = useEmailTabAvailability();
  return (id) => {
    const tab = availability(id);
    return tab === 'on' || (tab === 'loading' && state.tab === id);
  };
}