import { useQuery } from '@tanstack/react-query'; export interface UserProfile { id: string; name: string; email: string; avatarUrl?: string; bio?: string; } const FALLBACK_USER: UserProfile = { id: '1', name: 'Alex Johnson', email: 'alex.johnson@example.com', bio: 'On a journey to better mental health.', }; async function fetchUserProfile(): Promise { // Simulate API call // const response = await fetch(`${process.env.EXPO_PUBLIC_API_URL}/user/profile`); // if (!response.ok) throw new Error('Failed to fetch user profile'); // return response.json(); // Return fallback data for now return new Promise((resolve) => { setTimeout(() => resolve(FALLBACK_USER), 500); }); } export function useUser() { return useQuery({ queryKey: ['user-profile'], queryFn: fetchUserProfile, }); }