MCPcopy Create free account
hub / github.com/block/buzz / MemoryRefreshButton

Function MemoryRefreshButton

desktop/src/features/agent-memory/ui/MemorySection.tsx:55–93  ·  view source on GitHub ↗
({
  agentPubkey,
  viewerIsOwner,
  className,
  iconClassName,
  variant = "ghost",
}: {
  agentPubkey: string;
  viewerIsOwner: boolean;
  className?: string;
  iconClassName?: string;
  variant?: ButtonProps["variant"];
})

Source from the content-addressed store, hash-verified

53}
54
55export function MemoryRefreshButton({
56 agentPubkey,
57 viewerIsOwner,
58 className,
59 iconClassName,
60 variant = "ghost",
61}: {
62 agentPubkey: string;
63 viewerIsOwner: boolean;
64 className?: string;
65 iconClassName?: string;
66 variant?: ButtonProps["variant"];
67}): React.ReactElement | null {
68 const { query } = useAgentMemoryGraph(agentPubkey, {
69 enabled: viewerIsOwner,
70 });
71
72 if (!viewerIsOwner || !query.data) return null;
73
74 return (
75 <Button
76 aria-label="Refresh memory"
77 className={cn(className, query.isFetching && "cursor-wait")}
78 data-testid="agent-memory-refetch"
79 disabled={query.isFetching}
80 onClick={() => query.refetch()}
81 size="icon"
82 type="button"
83 variant={variant}
84 >
85 <RefreshCw
86 className={cn(
87 iconClassName ?? "h-4 w-4",
88 query.isFetching && "animate-spin",
89 )}
90 />
91 </Button>
92 );
93}
94
95function MemorySectionForOwner({ agentPubkey }: { agentPubkey: string }) {
96 const { query, graph } = useAgentMemoryGraph(agentPubkey);

Callers

nothing calls this directly

Calls 2

useAgentMemoryGraphFunction · 0.90
cnFunction · 0.90

Tested by

no test coverage detected