Files
kandev/apps/web/components/task/task-row-action-availability.ts
T
2026-09-17 19:00:34 +01:00

13 lines
485 B
TypeScript

import type { TaskSwitcherItem } from "./task-switcher-types";
/** Shared single-task eligibility for sidebar and palette entry points. */
export function taskRowActionAvailability(task: TaskSwitcherItem) {
return {
mark: !task.isArchived,
edit: !task.isArchived && Boolean(task.workflowId && task.workflowStepId),
nest: !task.isArchived && Boolean(task.workflowId),
move: !task.isArchived && Boolean(task.workflowId),
detach: Boolean(task.parentTaskId),
};
}