feat: add useEventReactions to system-react

This commit is contained in:
2023-10-16 21:24:54 +01:00
parent 3b427338f4
commit 5e42c5e70c
7 changed files with 83 additions and 76 deletions

View File

@ -140,29 +140,6 @@ export function hexToBech32(hrp: string, hex?: string) {
return "";
}
}
/**
* Reaction types
*/
export const Reaction = {
Positive: "+",
Negative: "-",
};
/**
* Return normalized reaction content
*/
export function normalizeReaction(content: string) {
switch (content) {
case "-":
return Reaction.Negative;
case "👎":
return Reaction.Negative;
default:
return Reaction.Positive;
}
}
export function getLinkReactions(
notes: ReadonlyArray<TaggedNostrEvent> | undefined,
link: NostrLink,