atmosphere explorer
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

show filtered record count

Juliet fb1989cc 60df3673

+17 -7
+17 -7
src/views/collection.tsx
··· 3 3 import { $type, ActorIdentifier, InferXRPCBodyOutput } from "@atcute/lexicons"; 4 4 import * as TID from "@atcute/tid"; 5 5 import { A, useParams } from "@solidjs/router"; 6 - import { createEffect, createResource, createSignal, For, Show, untrack } from "solid-js"; 6 + import { 7 + createEffect, 8 + createMemo, 9 + createResource, 10 + createSignal, 11 + For, 12 + Show, 13 + untrack, 14 + } from "solid-js"; 7 15 import { createStore } from "solid-js/store"; 8 16 import { Button } from "../components/button.jsx"; 9 17 import { JSONType, JSONValue } from "../components/json.jsx"; ··· 116 124 }; 117 125 118 126 const [response, { refetch }] = createResource(fetchRecords); 127 + 128 + const filteredRecords = createMemo(() => 129 + records.filter((rec) => 130 + filter() ? JSON.stringify(rec.record.value).includes(filter()!) : true, 131 + ), 132 + ); 119 133 120 134 const deleteRecords = async () => { 121 135 const recsToDel = records.filter((record) => record.toDelete); ··· 310 324 <span>{records.filter((rec) => rec.toDelete).length}</span> 311 325 <span>/</span> 312 326 </Show> 313 - <span>{records.length} records</span> 327 + <span>{filter() ? filteredRecords().length : records.length} records</span> 314 328 </div> 315 329 <div class="flex w-20 items-center justify-end"> 316 330 <Show when={cursor()}> ··· 327 341 </div> 328 342 </StickyOverlay> 329 343 <div class="flex max-w-full flex-col px-2 font-mono"> 330 - <For 331 - each={records.filter((rec) => 332 - filter() ? JSON.stringify(rec.record.value).includes(filter()!) : true, 333 - )} 334 - > 344 + <For each={filteredRecords()}> 335 345 {(record, index) => ( 336 346 <> 337 347 <Show when={batchDelete()}>