13 lines
485 B
TypeScript
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),
|
|
};
|
|
}
|