navigate(`/inbox/${value}`)}>
{canMarkAllRead && (
)}
{tab === "all" && (
{showApprovalsCategory && (
)}
)}
{approvalsError &&
{approvalsError.message}
}
{actionError &&
{actionError}
}
{!allLoaded && visibleSections.length === 0 && (
)}
{allLoaded && visibleSections.length === 0 && (
)}
{showWorkItemsSection && (
<>
{showSeparatorBefore("work_items") &&
}
{workItemsToRender.map((item) => {
if (item.kind === "approval") {
return (
approveMutation.mutate(item.approval.id)}
onReject={() => rejectMutation.mutate(item.approval.id)}
isPending={approveMutation.isPending || rejectMutation.isPending}
/>
);
}
if (item.kind === "failed_run") {
return (
dismiss(`run:${item.run.id}`)}
onRetry={() => retryRunMutation.mutate(item.run)}
isRetrying={retryingRunIds.has(item.run.id)}
/>
);
}
if (item.kind === "join_request") {
return (
approveJoinMutation.mutate(item.joinRequest)}
onReject={() => rejectJoinMutation.mutate(item.joinRequest)}
isPending={approveJoinMutation.isPending || rejectJoinMutation.isPending}
/>
);
}
const issue = item.issue;
const isUnread = issue.isUnreadForMe && !fadingOutIssues.has(issue.id);
const isFading = fadingOutIssues.has(issue.id);
const isMineTab = tab === "mine";
const isArchiving = archivingIssueIds.has(issue.id);
const row = (
{issue.identifier ?? issue.id.slice(0, 8)}
{liveIssueIds.has(issue.id) && (
Live
)}
>
)}
mobileMeta={
issue.lastExternalCommentAt
? `commented ${timeAgo(issue.lastExternalCommentAt)}`
: `updated ${timeAgo(issue.updatedAt)}`
}
unreadState={
isMineTab
? null
: isUnread ? "visible" : isFading ? "fading" : "hidden"
}
onMarkRead={() => markReadMutation.mutate(issue.id)}
desktopTrailing={
isMineTab ? (
archiveIssueMutation.mutate(issue.id)}
disabled={isArchiving || archiveIssueMutation.isPending}
/>
) : undefined
}
trailingMeta={
issue.lastExternalCommentAt
? `commented ${timeAgo(issue.lastExternalCommentAt)}`
: `updated ${timeAgo(issue.updatedAt)}`
}
/>
);
return isMineTab ? (
archiveIssueMutation.mutate(issue.id)}
>
{row}
) : row;
})}
>
)}
{showAlertsSection && (
<>
{showSeparatorBefore("alerts") &&
}
Alerts
{showAggregateAgentError && (
{dashboard!.agents.error}{" "}
{dashboard!.agents.error === 1 ? "agent has" : "agents have"} errors
)}
{showBudgetAlert && (
Budget at{" "}
{dashboard!.costs.monthUtilizationPercent}%{" "}
utilization this month
)}
>
)}
);
}