const API_URL = process.env.EXPO_PUBLIC_API_URL; export interface Product { id: number; title: string; price: number; description: string; category: string; image: string; rating: Rating; } export interface Rating { rate: number; count: number; } export const fetchProducts = async (): Promise => { const response = await fetch(`${API_URL}/products`); return response.json(); }; export const fetchProduct = async (id: number): Promise => { const response = await fetch(`${API_URL}/products/${id}`); return response.json(); }; export const getCategories = async (): Promise => { const response = await fetch(`${API_URL}/products/categories`); return response.json(); };