- context/
- hook/
- types/

### No Issue
This commit is contained in:
2025-08-19 15:25:07 +08:00
parent 1da4b00c2f
commit e1039a5744
10 changed files with 169 additions and 16 deletions

10
hook/use-auth.ts Normal file
View File

@@ -0,0 +1,10 @@
import { AuthContext } from "@/context/AuthContext";
import { useContext } from "react";
export const useAuth = () => {
const context = useContext(AuthContext);
if (!context) {
throw new Error("useAuth must be used within an AuthProvider");
}
return context;
};