mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-05-17 12:20:04 +00:00
16 lines
634 B
TypeScript
16 lines
634 B
TypeScript
import { DEFAULT_PROJECT_ID } from "@lib/constants"
|
|
import type { ContainerTagListType } from "@lib/types"
|
|
import { spaceSelectorDisplayName } from "@/lib/ingest-auto-space"
|
|
|
|
/** Label for the space sent as chat `metadata.projectId` (container tag). */
|
|
export function getChatSpaceDisplayLabel(options: {
|
|
selectedProject: string
|
|
allProjects: ContainerTagListType[]
|
|
}): string {
|
|
const { selectedProject, allProjects } = options
|
|
if (selectedProject === DEFAULT_PROJECT_ID) {
|
|
return "My Space"
|
|
}
|
|
const found = allProjects.find((p) => p.containerTag === selectedProject)
|
|
return spaceSelectorDisplayName(found, selectedProject)
|
|
}
|