'use client'; import React, { createContext, use } from 'react'; type User = { id: string; avatar?: string; // Чёто там ещё }; interface AuthContext { user: User | null; } const AuthContext = createContext(null); export const AuthContextProvider = ({ children }: React.PropsWithChildren) => { // TODO: подключить бэк const user = null; return ( {children} ); }; export const useAuthContext = () => { const context = use(AuthContext); if (!context) { throw new Error( 'useAuthContext must be used within AuthContextProvider', ); } return context; }; export const useUser = () => useAuthContext().user;