import { useQuery } from '@tanstack/react-query'; import { fetch } from '@tauri-apps/plugin-http'; import { Link } from 'react-router-dom'; import { useArk } from '@libs/ark'; import { LoaderIcon } from '@shared/icons'; import { compactNumber } from '@utils/formater'; export function PostCard() { const { ark } = useArk(); const { status, data } = useQuery({ queryKey: ['user-stats', ark.account.pubkey], queryFn: async ({ signal }: { signal: AbortSignal }) => { const res = await fetch( `https://api.nostr.band/v0/stats/profile/${ark.account.pubkey}`, { signal, } ); if (!res.ok) { throw new Error('Error'); } return await res.json(); }, refetchOnWindowFocus: false, refetchOnMount: false, refetchOnReconnect: false, staleTime: Infinity, }); return (
Posts
View