{"version":3,"file":"PollContext.mjs","names":[],"sources":["../../../src/context/PollContext.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport type { PropsWithChildren } from 'react';\nimport type { Poll } from 'stream-chat';\nimport { requireContext } from './requireContext';\n\nexport type PollContextValue = {\n  poll: Poll;\n};\n\nexport const PollContext = React.createContext<PollContextValue | undefined>(undefined);\n\nexport const PollProvider = ({\n  children,\n  poll,\n}: PropsWithChildren<{\n  poll: Poll;\n}>) =>\n  poll ? (\n    <PollContext.Provider value={{ poll } as unknown as PollContextValue}>\n      {children}\n    </PollContext.Provider>\n  ) : null;\n\nexport const usePollContext = () =>\n  requireContext(useContext(PollContext), 'usePollContext', 'PollProvider');\n"],"mappings":";;;;AASA,IAAa,cAAc,MAAM,cAA4C,KAAA,CAAS;AAEtF,IAAa,gBAAgB,EAC3B,UACA,WAIA,OACE,oBAAC,YAAY,UAAb;CAAsB,OAAO,EAAE,KAAK;CACjC;AACmB,CAAA,IACpB;AAEN,IAAa,uBACX,eAAe,WAAW,WAAW,GAAG,kBAAkB,cAAc"}