{"version":3,"file":"feedbackContext.cjs","sources":["../../../../src/components/feedback/feedbackContext.tsx"],"sourcesContent":["import React, { createContext, type FC, useContext } from \"react\";\nimport type { WithChildren } from \"../../core/types.js\";\nimport type { BaseTextAreaProps } from \"../text-area/types.js\";\n\ntype FeedbackContext = {\n    feedbackSubmitted: boolean;\n    followupStarted: boolean;\n    followupSubmitted: boolean;\n    contactSubmitted: boolean;\n    landmarkLabel?: string;\n    setFeedbackSubmitted: (state: boolean) => void;\n    setFollowupStarted: (state: boolean) => void;\n    setFollowupSubmitted: (state: boolean) => void;\n    setContactSubmitted: (state: boolean) => void;\n} & Pick<BaseTextAreaProps, \"counter\">;\n\nconst initialState: FeedbackContext = {\n    feedbackSubmitted: false,\n    followupStarted: false,\n    followupSubmitted: false,\n    contactSubmitted: false,\n    setFeedbackSubmitted: () => null,\n    setFollowupStarted: () => null,\n    setFollowupSubmitted: () => null,\n    setContactSubmitted: () => null,\n};\n\nconst feedbackContext = createContext(initialState);\n\nexport const useFeedbackContext = (): FeedbackContext =>\n    useContext(feedbackContext);\n\ninterface FeedbackContextProviderProps extends WithChildren {\n    value: FeedbackContext;\n}\n\nexport const FeedbackContextProvider: FC<FeedbackContextProviderProps> = ({\n    value,\n    children,\n}) => (\n    <feedbackContext.Provider value={value}>\n        {children}\n    </feedbackContext.Provider>\n);\n"],"names":["feedbackContext","createContext","feedbackSubmitted","followupStarted","followupSubmitted","contactSubmitted","setFeedbackSubmitted","setFollowupStarted","setFollowupSubmitted","setContactSubmitted","value","children","jsx","Provider","useContext"],"mappings":"wIA2BMA,EAAkBC,EAAAA,cAXc,CAClCC,mBAAmB,EACnBC,iBAAiB,EACjBC,mBAAmB,EACnBC,kBAAkB,EAClBC,qBAAsB,IAAM,KAC5BC,mBAAoB,IAAM,KAC1BC,qBAAsB,IAAM,KAC5BC,oBAAqB,IAAM,uCAY0C,EACrEC,MAAAA,EACAC,SAAAA,KAEAC,EAAAA,IAACZ,EAAgBa,SAAhB,CAAyBH,MAAAA,EACrBC,SAAAA,+BAZyB,IAC9BG,EAAAA,WAAWd"}