{"version":3,"file":"ReleaseAnnouncementContext.cjs","names":[],"sources":["../../../src/components/ReleaseAnnouncement/ReleaseAnnouncementContext.ts"],"sourcesContent":["/*\nCopyright 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport { createContext, useContext } from \"react\";\nimport { useReleaseAnnouncement } from \"./useReleaseAnnouncement\";\n\ntype ContextType = ReturnType<typeof useReleaseAnnouncement> | null;\n/**\n * The context for the ReleaseAnnouncement components.\n */\nexport const ReleaseAnnouncementContext = createContext<ContextType>(null);\n\n/**\n * Provides the context for the ReleaseAnnouncement components.\n */\nexport function useReleaseAnnouncementContext() {\n  const context = useContext(ReleaseAnnouncementContext);\n\n  if (context == null) {\n    throw new Error(\n      \"ReleaseAnnouncement components must be wrapped in <ReleaseAnnouncement />\",\n    );\n  }\n\n  return context;\n}\n"],"mappings":";;;;;;AAcA,IAAa,8BAAA,GAAA,MAAA,eAAwD,KAAK;;;;AAK1E,SAAgB,gCAAgC;CAC9C,MAAM,WAAA,GAAA,MAAA,YAAqB,2BAA2B;AAEtD,KAAI,WAAW,KACb,OAAM,IAAI,MACR,4EACD;AAGH,QAAO"}