UNPKG

better-auth-dashboard

Version:

A better-Auth powered admin dashboard.

16 lines (12 loc) 325 B
"use client"; import { useContext } from "react"; import { dashboardContext } from "../dashboardContext"; export const useDashboard = () => { const ctx = useContext(dashboardContext); if (!ctx) { throw new Error( `The useDashboard hook must be used in as a child of <Dashboard>.` ); } return ctx; };