import { useEffect, useState } from 'react';
import Profile from '../../features/user/Profile';
import { useRoute, useNavigation } from '@react-navigation/native';
export function UserProfileScreen({
  defaultUserId
}) {
  var _route$params;
  const route = useRoute();
  const navigation = useNavigation();
  const userIdFromRoute = route === null || route === void 0 || (_route$params = route.params) === null || _route$params === void 0 ? void 0 : _route$params.userId;
  const [userId, setUserId] = useState('');
  useEffect(() => {
    const routes = navigation.getState().routes;
    if (defaultUserId && routes.length === 1) {
      setUserId(defaultUserId);
    } else if (userIdFromRoute) {
      setUserId(userIdFromRoute);
    }
    return () => {
      setUserId('');
    };
  }, [defaultUserId, navigation, userIdFromRoute]);
  return /*#__PURE__*/React.createElement(Profile, {
    userId: userId,
    inline: !!defaultUserId && !userIdFromRoute
  });
}
//# sourceMappingURL=UserProfile.js.map