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.

716 B
Raw Blame
import { DRIVE_TABS, type DriveFolder, type DriveLocation } from './types';

export function driveLocationLabel(
  location: DriveLocation,
  folders: readonly DriveFolder[] = []
): string {
  if (location.kind === 'folder') {
    return folders.find((folder) => folder.id === location.id)?.name ?? 'Drive';
  }
  return DRIVE_TABS.find((tab) => tab.id === location.tab)?.label ?? 'My Files';
}

/** Where Drive's New menu creates items: the open folder, else the root. */
export function driveCreateDestinationLabel(
  projectId: string | undefined,
  folders: readonly DriveFolder[] = []
): string {
  if (!projectId) return 'Drive';
  return folders.find((folder) => folder.id === projectId)?.name ?? 'Folder';
}