Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

471 B
Raw Blame
type LabelSource = {
  id: string;
  name: string;
  color: string;
};

export type FeedLabel = {
  id: string;
  name: string | null;
  color: string;
};

export function resolveFeedLabels(
  labelIds: string[],
  labels: LabelSource[],
): FeedLabel[] {
  return labelIds.map((id) => {
    const label = labels.find((candidate) => candidate.id === id);
    return label
      ? { id, name: label.name, color: label.color }
      : { id, name: null, color: "" };
  });
}