feat(agent): Add linked board display for agent profile with conditional rendering
This commit is contained in:
@@ -101,6 +101,10 @@ export default function AgentDetailPage() {
|
|||||||
if (!agent) return [];
|
if (!agent) return [];
|
||||||
return events.filter((event) => event.agent_id === agent.id);
|
return events.filter((event) => event.agent_id === agent.id);
|
||||||
}, [events, agent]);
|
}, [events, agent]);
|
||||||
|
const linkedBoard = useMemo(() => {
|
||||||
|
if (!agent?.board_id) return null;
|
||||||
|
return boards.find((board) => board.id === agent.board_id) ?? null;
|
||||||
|
}, [boards, agent?.board_id]);
|
||||||
|
|
||||||
const loadAgent = async () => {
|
const loadAgent = async () => {
|
||||||
if (!isSignedIn || !agentId) return;
|
if (!isSignedIn || !agentId) return;
|
||||||
@@ -261,10 +265,16 @@ export default function AgentDetailPage() {
|
|||||||
<p className="text-xs font-semibold uppercase tracking-[0.2em] text-quiet">
|
<p className="text-xs font-semibold uppercase tracking-[0.2em] text-quiet">
|
||||||
Board
|
Board
|
||||||
</p>
|
</p>
|
||||||
<p className="mt-1 text-sm text-strong">
|
{linkedBoard ? (
|
||||||
{boards.find((board) => board.id === agent.board_id)?.name ??
|
<Link
|
||||||
"—"}
|
href={`/boards/${linkedBoard.id}`}
|
||||||
</p>
|
className="mt-1 inline-flex text-sm font-medium text-[color:var(--accent)] transition hover:underline"
|
||||||
|
>
|
||||||
|
{linkedBoard.name}
|
||||||
|
</Link>
|
||||||
|
) : (
|
||||||
|
<p className="mt-1 text-sm text-strong">—</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p className="text-xs font-semibold uppercase tracking-[0.2em] text-quiet">
|
<p className="text-xs font-semibold uppercase tracking-[0.2em] text-quiet">
|
||||||
|
|||||||
Reference in New Issue
Block a user