import { Profile, ProfileTypeEnum } from '@bit-ui-libs/common'; import { useQuery } from '@tanstack/react-query'; import { useServicesStore, useUserId } from '../../../stores'; interface UseGetDefaultProfileOpts { profileType: ProfileTypeEnum; onSuccess?: (p: TProfile) => void; onError?: (err: unknown) => void; } export function useGetDefaultProfile(opts: UseGetDefaultProfileOpts) { const userId = useUserId(); const service = useServicesStore(s => s[opts.profileType]); return useQuery({ queryKey: ['default-profile', opts.profileType, userId, service], queryFn: () => service.getDefaultProfile(), }); }