fuzzy search on search page

This commit is contained in:
Martti Malmi
2024-01-11 10:39:03 +02:00
parent 45f66fd139
commit eb9cf7f361
7 changed files with 109 additions and 83 deletions

View File

@ -1,6 +1,6 @@
import { dedupe } from "@snort/shared";
import { HexKey } from "@snort/system";
import { ReactNode } from "react";
import { ReactNode, useMemo } from "react";
import { FormattedMessage } from "react-intl";
import { FollowsFeed } from "@/Cache";
@ -35,6 +35,8 @@ export default function FollowListBase({
const { id, follows } = useLogin(s => ({ id: s.id, follows: s.follows }));
const login = useLogin();
const profilePreviewOptions = useMemo(() => ({ about: showAbout, profileCards: true }), [showAbout]);
async function followAll() {
if (publisher) {
const newFollows = dedupe([...pubkeys, ...follows.item]);
@ -57,12 +59,13 @@ export default function FollowListBase({
</div>
)}
<div className={className}>
{pubkeys?.map(a => (
{pubkeys?.map((a, index) => (
<ProfilePreview
pubkey={a}
key={a}
options={{ about: showAbout, profileCards: true }}
options={profilePreviewOptions}
actions={profileActions?.(a)}
waitUntilInView={index > 10}
/>
))}
</div>