{"version":3,"file":"PollContent.mjs","names":[],"sources":["../../../../src/components/Poll/PollContent.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport React from 'react';\nimport { PollHeader as DefaultPollHeader } from './PollHeader';\nimport { PollActions as DefaultPollActions } from './PollActions';\nimport { PollOptionList } from './PollOptionList';\nimport { MAX_OPTIONS_DISPLAYED } from './constants';\nimport { useComponentContext, usePollContext } from '../../context';\nimport { useStateStore } from '../../store';\nimport type { PollState } from 'stream-chat';\n\ntype PollStateSelectorPollContentReturnValue = { is_closed: boolean | undefined };\nconst pollStateSelectorPollContent = (\n  nextValue: PollState,\n): PollStateSelectorPollContentReturnValue => ({ is_closed: nextValue.is_closed });\nexport const PollContent = () => {\n  const { PollActions = DefaultPollActions, PollHeader = DefaultPollHeader } =\n    useComponentContext();\n  const { poll } = usePollContext();\n  const { is_closed } = useStateStore(poll.state, pollStateSelectorPollContent);\n\n  return (\n    <div className={clsx('str-chat__poll', { 'str-chat__poll--closed': is_closed })}>\n      <PollHeader />\n      <PollOptionList optionsDisplayCount={MAX_OPTIONS_DISPLAYED} />\n      <PollActions />\n    </div>\n  );\n};\n"],"mappings":";;;;;;;;;;AAWA,IAAM,gCACJ,eAC6C,EAAE,WAAW,UAAU,UAAU;AAChF,IAAa,oBAAoB;CAC/B,MAAM,EAAE,aAAA,gBAAc,aAAoB,YAAA,eAAa,eACrD,oBAAoB;CACtB,MAAM,EAAE,SAAS,eAAe;CAChC,MAAM,EAAE,cAAc,cAAc,KAAK,OAAO,4BAA4B;CAE5E,OACE,qBAAC,OAAD;EAAK,WAAW,KAAK,kBAAkB,EAAE,0BAA0B,UAAU,CAAC;YAA9E;GACE,oBAAC,cAAD,CAAa,CAAA;GACb,oBAAC,gBAAD,EAAgB,qBAAA,EAA6C,CAAA;GAC7D,oBAAC,eAAD,CAAc,CAAA;EACX;;AAET"}