Files
kandev/apps/web/lib/utils/needs-action.ts
T
2026-02-19 22:18:01 +00:00

17 lines
499 B
TypeScript

import type { TaskState } from "@/lib/types/http";
/**
* Determines if a task needs user attention/action.
* Used for visual highlighting across kanban views.
*/
export function needsAction(task: {
state?: TaskState;
reviewStatus?: "pending" | "approved" | "changes_requested" | "rejected" | null;
}): boolean {
return (
(task.reviewStatus === "pending" && task.state !== "IN_PROGRESS") ||
task.reviewStatus === "changes_requested" ||
task.state === "WAITING_FOR_INPUT"
);
}