From c3dcb9c827df6d80ad1b0b1a7c6155561527b39d Mon Sep 17 00:00:00 2001
From: l3wdfut4pwr <l3wdfut4pwr@gmail.com>
Date: Tue, 30 Dec 2025 13:46:39 +0200
Subject: init

---
 src/lib/contexts/Auth.context.tsx | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 src/lib/contexts/Auth.context.tsx

(limited to 'src/lib/contexts/Auth.context.tsx')

diff --git a/src/lib/contexts/Auth.context.tsx b/src/lib/contexts/Auth.context.tsx
new file mode 100644
index 0000000..ff2d369
--- /dev/null
+++ b/src/lib/contexts/Auth.context.tsx
@@ -0,0 +1,37 @@
+'use client';
+
+import React, { createContext, use } from 'react';
+
+type User = {
+    id: string;
+    avatar?: string;
+    // Чёто там ещё
+};
+
+interface AuthContext {
+    user: User | null;
+}
+
+const AuthContext = createContext<AuthContext | null>(null);
+
+export const AuthContextProvider = ({ children }: React.PropsWithChildren) => {
+    // TODO: подключить бэк
+    const user = null;
+    return (
+        <AuthContext.Provider value={{ user }}>{children}</AuthContext.Provider>
+    );
+};
+
+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;
-- 
cgit v1.3-3-g829e

