Skip to main content
Glama
TabContext.tsx982 B
'use client'; import { createContext, type Dispatch, type FC, type PropsWithChildren, type SetStateAction, useContext, useState, } from 'react'; type TabContextValue = { tabsValues: Record<string, any>; setTabsValues: Dispatch<SetStateAction<Record<string, any>>>; }; /** * Context that store the current locale on the client side */ export const TabContext = createContext<TabContextValue>({ tabsValues: {}, setTabsValues: (() => {}) as Dispatch<SetStateAction<Record<string, any>>>, }); /** * Hook that provides the current locale */ export const useTabContext = () => useContext(TabContext); /** * Provider that store the current locale on the client side */ export const TabProvider: FC<PropsWithChildren> = ({ children }) => { const [tabsValues, setTabsValues] = useState<Record<string, any>>({}); return ( <TabContext value={{ tabsValues, setTabsValues, }} > {children} </TabContext> ); };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aymericzip/intlayer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server