@transkripid/flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS - Transkrip.id fork
1 lines • 978 B
Source Map (JSON)
{"version":3,"file":"ModalContext.mjs","sources":["../../../src/components/Modal/ModalContext.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, useContext } from 'react';\nimport type { FlowbiteModalTheme } from './Modal';\n\ntype ModalContext = {\n theme: FlowbiteModalTheme;\n popup?: boolean;\n setHeaderId: (id: string | undefined) => void;\n onClose?: () => void;\n};\n\nexport const ModalContext = createContext<ModalContext | undefined>(undefined);\n\nexport function useModalContext(): ModalContext {\n const context = useContext(ModalContext);\n\n if (!context) {\n throw new Error('useModalContext should be used within the ModalContext provider!');\n }\n\n return context;\n}\n"],"names":["ModalContext","createContext","undefined","useModalContext","context","useContext","Error"],"mappings":";AAYaA,MAAAA,IAAeC,EAAwCC,MAAS;AAEtE,SAAAC,IAAA;AACLC,QAAAA,IAAgBC,EAAAL,CAAuB;AAAE,MAAA,CAEpCI;AAAOE,UAAAA,IAAAA,MACM,kEAAkE;AAG7EF,SAAAA;AAAO;"}