import useAuth from '../../../../../core/hooks/useAuth';
import useSocialSettings from '../../../../../core/hooks/useSocialSettings';
import { useFollowInfo } from '../../../../hooks/objects';
export function useFeedState({
  userId,
  isBrand,
  isUserLoading
}) {
  const {
    client
  } = useAuth();
  const {
    socialSettings
  } = useSocialSettings();
  const {
    followInfo
  } = useFollowInfo({
    userId,
    enabled: !!userId
  });
  const isMyProfile = (client === null || client === void 0 ? void 0 : client.userId) === userId;
  const isBlockedByMe = (followInfo === null || followInfo === void 0 ? void 0 : followInfo.status) === 'blocked';
  const isFollowing = (followInfo === null || followInfo === void 0 ? void 0 : followInfo.status) === 'accepted';
  const isPrivate = !isMyProfile && (isBrand || (socialSettings === null || socialSettings === void 0 ? void 0 : socialSettings.userPrivacySetting) === 'private') && !isFollowing;

  // Hold feedEnabled false while the user object is still loading so brand-private
  // profiles don't flash feed content before isBrand is known.
  const isBrandResolved = isMyProfile || !isUserLoading;
  const feedEnabled = isBrandResolved && !isBlockedByMe && !isPrivate;
  return {
    isBlockedByMe,
    isPrivate,
    feedEnabled
  };
}
//# sourceMappingURL=useFeedState.js.map