import { api } from './axios'; import { useQuery } from '@tanstack/react-query'; export interface PublicProfile { id: string; fullName: string | null; avatarUrl: string | null; primaryRole: string; } /** * Получение публичной информации о пользователе */ export const getPublicProfile = async (userId: string): Promise => { const response = await api.get(`/profile/public/${userId}`); return response.data; }; /** * Хук для получения публичного профиля */ export const usePublicProfile = (userId: string | undefined) => { return useQuery({ queryKey: ['publicProfile', userId], queryFn: () => getPublicProfile(userId!), enabled: !!userId, staleTime: 10 * 60 * 1000, // 10 минут }); };