import { useStore } from './utils/store' import { adminStore } from './admin-store' import { RACCOON_DEV_ACCOUNT, RACCOON_DEV_COUNTRY, RACCOON_DEV_CURRENCY, RACCOON_DEV_ENABLED, RACCOON_DEV_LOCALE, RACCOON_DEV_VTEX_ID_TOKEN, RACCOON_DEV_WORKSPACE, } from './dev' if (process.env.NODE_ENV === 'development') { if (RACCOON_DEV_ENABLED) { adminStore.set({ token: RACCOON_DEV_VTEX_ID_TOKEN, account: RACCOON_DEV_ACCOUNT, workspace: RACCOON_DEV_WORKSPACE, locale: RACCOON_DEV_LOCALE, currency: RACCOON_DEV_CURRENCY, country: RACCOON_DEV_COUNTRY, production: false, // Values that are only meaningful when // developing within the VTEX Admin. prodUrl: 'NIL', basePath: 'NIL', topWindowHref: 'NIL', path: 'NIL', }) } else { console.warn( 'Have you heard of @vtex/raccoon-dev? Use this package to develop your Next.js Admin Application directly on http://localhost:PORT!', ) } } export function useAdmin() { return useStore(adminStore) }