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.

634 B
Raw Blame
import { renderCell, text } from "../render/cell.js";
import type { Ui } from "../render/ui.js";

export type Assignment = {
  readonly label: string;
  readonly url: string;
  readonly assignee: { readonly name: string } | null;
};

export function renderAssignment(ui: Ui, assignment: Assignment): string[] {
  const { theme, glyphs } = ui;
  const id = renderCell(
    [text(assignment.label, theme.strong, assignment.url)],
    ui,
  );
  const outcome = assignment.assignee
    ? `assigned to ${theme.strong(assignment.assignee.name)}`
    : "unassigned";
  return ["", `  ${theme.success(glyphs.tick)} ${id} ${outcome}`, ""];
}