Create src/renderer/components/ui/icons.ts as the single re-export point
for every Phosphor icon the renderer touches, then rewrite the 95 files
that previously imported directly from "@phosphor-icons/react" to pull
from the relative-path-to-barrel instead. The TitleBar commit earlier
in this series already used ui/icons; this commit extends the pattern
to the rest of the renderer.
Benefits now wired in:
- one location where bundle tree-shaking can be reasoned about,
- typos like Briefcase vs BriefCase show up against a finite list,
- re-theming or swapping icon sets is a one-file edit,
- a lint rule that flags raw @phosphor-icons/react imports can be
added later without mass-rewriting call sites.
The barrel also re-exports the `Icon` type so call sites that type
icon props against the Phosphor component type work unchanged.
Test count stays at 363 passing; typecheck stays at 156 errors.
28 lines
1.5 KiB
TypeScript
28 lines
1.5 KiB
TypeScript
import { Robot } from "../ui/icons"
|
|
import type { AgentRecord, TaskRecord } from "@shared/types"
|
|
import { useT } from "../../i18n"
|
|
import { EmptyState, ListFrame } from "../ui"
|
|
|
|
export function PendingReviewList({ tasks, agents }: { tasks: TaskRecord[]; agents: AgentRecord[] }) {
|
|
const t = useT()
|
|
const reviewTasks = tasks.filter((tk) => tk.status === "in_review")
|
|
if (reviewTasks.length === 0) return <EmptyState title={t("exec.noReviewsInProgress")} detail={t("exec.noReviewsDetail")} />
|
|
return (
|
|
<ListFrame>
|
|
{reviewTasks.map((task) => {
|
|
const assignee = agents.find((a) => a.id === task.assigneeAgentId) ?? null
|
|
const reviewer = assignee?.reportsTo ? (agents.find((a) => a.id === assignee.reportsTo) ?? null) : null
|
|
return (
|
|
<div key={task.id} className="flex items-start gap-3 border-b border-border px-4 py-3 last:border-b-0">
|
|
<Robot size={16} weight="fill" className="mt-0.5 shrink-0 text-primary" />
|
|
<div className="min-w-0 flex-1">
|
|
<div className="truncate text-[13px] font-medium text-foreground">{task.title}</div>
|
|
<div className="mt-0.5 text-[11px] text-muted-foreground">{assignee ? assignee.name : "Unassigned"}{reviewer ? <> → reviewed by <span className="text-muted-foreground">{reviewer.name}{reviewer.title ? ` (${reviewer.title})` : ""}</span></> : " · awaiting review"}</div>
|
|
</div>
|
|
</div>
|
|
)
|
|
})}
|
|
</ListFrame>
|
|
)
|
|
}
|