Extract admin dashboard from ghabilee-frontend2 into a dedicated Next.js app for backoffice.ghabilee.ir (no SEO indexing / Clarity).
16 lines
307 B
TypeScript
16 lines
307 B
TypeScript
import { useContext } from 'react'
|
|
|
|
import { LoadingContext } from '@/context/LoadingContext'
|
|
|
|
const useLoading = () => {
|
|
const context = useContext(LoadingContext)
|
|
|
|
if (!context) {
|
|
throw new Error('useLoading must be used within LoadingProvider')
|
|
}
|
|
|
|
return context
|
|
}
|
|
|
|
export default useLoading
|