UNPKG

@transkripid/flowbite-react

Version:

Official React components built for Flowbite and Tailwind CSS - Transkrip.id fork

1 lines 948 B
{"version":3,"file":"SidebarContext.mjs","sources":["../../../src/components/Sidebar/SidebarContext.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, useContext } from 'react';\nimport type { FlowbiteSidebarTheme } from './Sidebar';\n\nexport type SidebarContext = {\n theme: FlowbiteSidebarTheme;\n isCollapsed: boolean;\n};\n\nexport const SidebarContext = createContext<SidebarContext | undefined>(undefined);\n\nexport function useSidebarContext(): SidebarContext {\n const context = useContext(SidebarContext);\n\n if (!context) {\n throw new Error('useSidebarContext should be used within the SidebarContext provider!');\n }\n\n return context;\n}\n"],"names":["SidebarContext","createContext","undefined","useSidebarContext","context","useContext","Error"],"mappings":";AAUaA,MAAAA,IAAiBC,EAA0CC,MAAS;AAE1E,SAAAC,IAAA;AACLC,QAAAA,IAAgBC,EAAAL,CAAyB;AAAE,MAAA,CAEtCI;AAAOE,UAAAA,IAAAA,MACM,sEAAsE;AAGjFF,SAAAA;AAAO;"}