{/* Empty state */}
{computed(() =>
registryEntries.length === 0
? (
No queries registered yet. Gmail-agent patterns will
submit queries here.
)
: null
)}
{/* Registry entries - using native details/summary for expand/collapse */}
{registryEntries.map((registry) => (
{registry.agentTypeName || extractAgentName(registry.url)}
{registry.queries.length}{" "}
{registry.queries.length === 1 ? "query" : "queries"}
{/* Queries list */}
{computed(() => {
// Safely extract queries array (may be opaque during compilation)
const queriesArray = registry.queries || [];
if (!Array.isArray(queriesArray)) return null;
return queriesArray
.filter((q) => q && q.query) // Filter out null/undefined during hydration
.sort((a, b) =>
((b.upvotes || 0) - (b.downvotes || 0)) -
((a.upvotes || 0) - (a.downvotes || 0))
)
.map((query) => (
{query.query}
{query.description && (
{query.description}
)}
+{query.upvotes || 0}
{" / "}
-{query.downvotes || 0}
{query.submittedBy
? ` ยท by ${query.submittedBy}`
: ""}
{query.submittedAt
? new Date(query.submittedAt)
.toLocaleDateString()
: ""}
));
})}
))}
{/* Setup instructions */}