This commit is contained in:
payacom
2026-09-03 16:04:52 +03:30
parent 76ef4e32a9
commit bf41ad4e0f
65 changed files with 1248 additions and 999 deletions

View File

@@ -0,0 +1,18 @@
import { getApiBaseUrl } from "@/components/main/BaseUrl";
export type TopHashtag = { tag: string; viewsCount: number };
// ۱۰ هشتگ برتر بر اساس مجموع بازدید در ۳۰ روز جاری — همون endpoint‌ای که اپ اندروید
// برای فیلتر «هشتگ‌های برتر ماه» توی اکسپلور استفاده می‌کنه
export async function fetchTopHashtags(limit = 10): Promise<TopHashtag[]> {
try {
const res = await fetch(
`${getApiBaseUrl()}/users/explore/top-hashtags?limit=${limit}`
);
if (!res.ok) return [];
const data = (await res.json()) as { hashtags?: TopHashtag[] };
return data.hashtags ?? [];
} catch {
return [];
}
}