{"version":3,"file":"index-71ea7263.js","sources":["../../../client-app/src/common/components/ErrorMessage/index.tsx"],"sourcesContent":["import { DismissableErrorMessageProps, useDismissableErrorMessage } from '@n2-common/ui';\nimport { PropsWithChildren, createContext, useContext } from 'react';\n\ntype ErrorMessageContextType = (error: DismissableErrorMessageProps['error']) => void;\n\nconst ErrorMessageContext = createContext(null);\n\nexport const ErrorMessageProvider: React.FC = ({ children }) => {\n const { ErrorOutput, setErrorMessage } = useDismissableErrorMessage();\n return (\n <>\n {children}\n \n \n );\n};\n\nexport function useErrorMessage() {\n const context = useContext(ErrorMessageContext);\n if (!context) {\n throw new Error('useErrorMessage hook is only useable in tree under ErrorMessageContext element.');\n }\n return context;\n}\n"],"names":["ErrorMessageContext","createContext","ErrorMessageProvider","children","ErrorOutput","setErrorMessage","useDismissableErrorMessage","jsxs","Fragment","jsx","useErrorMessage","context","useContext"],"mappings":"6DAKA,MAAMA,EAAsBC,EAAAA,cAA8C,IAAI,EAEjEC,EAAoD,CAAC,CAAE,SAAAC,KAAe,CAC/E,KAAM,CAAE,YAAAC,EAAa,gBAAAC,CAAgB,EAAIC,EAA2B,EACpE,OAEQC,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAAC,EAAA,IAACT,EAAoB,SAApB,CAA6B,MAAOK,EAAkB,SAAAF,EAAS,QAC/DC,EAAY,EAAA,CACjB,CAAA,CAAA,CAER,EAEO,SAASM,GAAkB,CACxB,MAAAC,EAAUC,aAAWZ,CAAmB,EAC9C,GAAI,CAACW,EACK,MAAA,IAAI,MAAM,iFAAiF,EAE9F,OAAAA,CACX"}