Skip to content

⭐️⭐️⭐️ Open-source, self-hosted alternative to Linear and Plane. Project management and issue tracking where teams and AI agents work side by side to plan and ship products.

500 B
Raw Blame
import type { ProjectDocumentSummary } from '@/lib/api/endpoints/documents';

export const DOCUMENT_LIST_TABS = ['favorites', 'public', 'private', 'archived'] as const;

export type DocumentListTab = (typeof DOCUMENT_LIST_TABS)[number];

export function documentBelongsToTab(document: ProjectDocumentSummary, tab: DocumentListTab) {
  if (tab === 'archived') return true;
  if (tab === 'favorites') return document.isFavorite;
  return tab === 'private' ? document.isPrivate : !document.isPrivate;
}