[Glitch] Emoji: Statuses

Port 0c1ca6c969 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Echo authored and Claire committed 2025-10-08 18:45:30 +02:00
1 parent c4ef050eb6
commit c08a874ba9
14 files changed
+128 -85

No files matched your search

@@ -83,14 +83,15 @@ export const HandledLink: FC<HandledLinkProps & ComponentProps<'a'>> = ({
export const useElementHandledLink = ({
hashtagAccountId,
mentionAccountId,
hrefToMentionAccountId,
}: {
hashtagAccountId?: string;
mentionAccountId?: string;
hrefToMentionAccountId?: (href: string) => string | undefined;
} = {}) => {
const onElement = useCallback<OnElementHandler>(
(element, { key, ...props }) => {
if (element instanceof HTMLAnchorElement) {
const mentionId = hrefToMentionAccountId?.(element.href);
return (
<HandledLink
{...props}
@@ -98,13 +99,13 @@ export const useElementHandledLink = ({
href={element.href}
text={element.innerText}
hashtagAccountId={hashtagAccountId}
mentionAccountId={mentionAccountId}
mentionAccountId={mentionId}
/>
);
}
return undefined;
},
[hashtagAccountId, mentionAccountId],
[hashtagAccountId, hrefToMentionAccountId],
);
return { onElement };
};