profile header n shit

This commit is contained in:
2025-08-15 16:15:28 +03:00
parent aec0052ef5
commit 6a1d81bfa8
17 changed files with 352 additions and 62 deletions

View File

@@ -12,15 +12,15 @@ export function useRobuxBalance() {
const { data: robux } = useQuery<number | false | null>({
queryKey: ["robux-balance", acct ? acct.id : "acctId"],
queryFn: async () => {
if (!acct) return null;
if (!acct) return 0;
try {
const res = await proxyFetch(
`https://economy.roblox.com/v1/users/${acct.id}/currency`
);
const data = await res.json();
return data.robux;
return data.robux || 0;
} catch {
return false;
return 0;
}
},
enabled: !!acct,

View File

@@ -0,0 +1,17 @@
"use client";
import { useQuery } from "@tanstack/react-query";
import {
getThumbnails,
ThumbnailRequest,
AssetThumbnail
} from "@/lib/thumbnailLoader";
export function useThumbnails(requests: ThumbnailRequest[]) {
return useQuery<AssetThumbnail[], Error>({
queryKey: ["thumbnails", requests.map((r) => r.targetId)],
queryFn: () => getThumbnails(requests),
staleTime: 1000 * 60 * 5, // 5 minutes
enabled: false
});
}