feat: lang specific trending

This commit is contained in:
2023-11-10 09:54:08 +00:00
parent 98f6a686b0
commit 70fd872848
2 changed files with 8 additions and 2 deletions

View File

@ -6,15 +6,17 @@ import PageSpinner from "Element/PageSpinner";
import Note from "Element/Event/Note";
import NostrBandApi from "External/NostrBand";
import { ErrorOrOffline } from "Element/ErrorOrOffline";
import { useLocale } from "IntlProvider";
export default function TrendingNotes() {
const [posts, setPosts] = useState<Array<NostrEvent>>();
const [error, setError] = useState<Error>();
const { lang } = useLocale();
const related = useReactions("trending", posts?.map(a => NostrLink.fromEvent(a)) ?? [], undefined, true);
async function loadTrendingNotes() {
const api = new NostrBandApi();
const trending = await api.trendingNotes();
const trending = await api.trendingNotes(lang);
setPosts(trending.notes.map(a => a.event));
}