kodadot/nft-gallery

View on GitHub
composables/useProfile.ts

Summary

Maintainability
A
0 mins
Test Coverage
export enum Socials {
  Twitter = 'Twitter',
  Website = 'Website',
  Farcaster = 'Farcaster',
}

export default function useUserProfile(address?: Ref<string>) {
  const { accountId } = useAuth()

  const {
    profile,
    refetch: fetchProfile,
    isLoading,
  } = useFetchProfile(computed(() => address?.value || accountId.value))

  return {
    hasProfile: computed(() => Boolean(profile.value)),
    userProfile: profile,
    fetchProfile,
    isFetchingProfile: isLoading,
  }
}