/**
 * 用户主页 UserScreen
 * 胡萝卜BBS - 查看其他用户资料
 * 使用统一的 UserProfileScreen 组件，mode='other'
 */

import React from 'react';
import { useLocalSearchParams } from 'expo-router';
import UserProfileScreen from './UserProfileScreen';
import { useCurrentUser } from '../../stores/authStore';

export const UserScreen: React.FC = () => {
  const { userId: userIdParam } = useLocalSearchParams<{ userId?: string }>();
  const userId = userIdParam || '';
  const currentUser = useCurrentUser();
  const isSelfProfile = !!currentUser?.id && currentUser.id === userId;
  
  return (
    <UserProfileScreen
      mode={isSelfProfile ? 'self' : 'other'}
      userId={isSelfProfile ? undefined : userId}
    />
  );
};

export default UserScreen;
