update threads (kind 30023) page

This commit is contained in:
Ren Amamiya
2023-05-16 09:56:24 +07:00
parent 180e31d1bd
commit 7e8e5a931b
4 changed files with 77 additions and 13 deletions

View File

@@ -1,8 +1,15 @@
import { useProfile } from "@utils/hooks/useProfile";
import { shortenKey } from "@utils/shortenKey";
const hexRegex = /[0-9A-Fa-f]{6}/g;
export function MentionUser(props: { children: any[] }) {
const pubkey = props.children[0];
const pubkey = props.children[0].match(hexRegex) ? props.children[0] : null;
if (!pubkey) {
return null;
}
const { user } = useProfile(pubkey);
return (