···
import { Button } from "./button.jsx";
counts: { distinct_dids: number; records: number };
const linksBySource = (links: Record<string, any>) => {
+
let out: Record<string, Backlink[]> = {};
.forEach((collection) => {
···
if (paths[path].records === 0) return;
+
if (out[collection]) out[collection].push({ path, counts: paths[path] });
+
else out[collection] = [{ path, counts: paths[path] }];
···
<div class="flex w-full flex-col gap-1 text-sm wrap-anywhere">
+
when={response() && Object.keys(response()!).length}
+
fallback={<p>No backlinks found.</p>}
+
<For each={Object.keys(response()!)}>
<div class="flex items-center gap-1">
···
+
<For each={response()![collection]}>
+
{({ path, counts }) => (
+
<div class="flex items-center gap-1">
+
title="Record path where the link is found"
+
class="iconify lucide--route shrink-0"
+
class="text-blue-400 hover:underline active:underline"
+
title="Show linking records"
+
show()?.collection === collection &&
+
show()?.path === path &&
+
: setShow({ collection, path, showDids: false })
+
{counts.records} record{counts.records < 2 ? "" : "s"}
+
class="text-blue-400 hover:underline active:underline"
+
title="Show linking DIDs"
+
show()?.collection === collection &&
+
show()?.path === path &&
+
: setShow({ collection, path, showDids: true })
+
{counts.distinct_dids} DID
+
{counts.distinct_dids < 2 ? "" : "s"}
+
<Show when={show()?.collection === collection && show()?.path === path}>
+
<Show when={show()?.showDids}>
+
<p class="w-full font-semibold">Distinct identities</p>
+
collection={collection}
+
<Show when={!show()?.showDids}>
+
<p class="w-full font-semibold">Records</p>
+
collection={collection}