import { View } from 'react-native';
import { useStyles } from './style';
import { PollFooter } from './PollFooter';
import { PollOptions } from './PollOption';
import { usePoll } from '../../hooks/usePoll';
import { Typography } from '../../../core/components/Typography/Typography';
const PollContent = ({
  post,
  pollId,
  disabledPoll,
  showedAllOptions
}) => {
  const {
    styles
  } = useStyles();
  const {
    poll,
    votePoll,
    unvotePoll,
    totalVotes,
    isPollClosed,
    isAlreadyVoted,
    isAuthorSeeingResults,
    setIsAuthorSeeingResults
  } = usePoll(pollId);
  if (!poll) return null;
  return /*#__PURE__*/React.createElement(View, {
    style: styles.container
  }, !isPollClosed && !isAlreadyVoted && /*#__PURE__*/React.createElement(View, {
    style: styles.header
  }, /*#__PURE__*/React.createElement(Typography.CaptionBold, {
    style: styles.baseShade2
  }, "Select one option")), /*#__PURE__*/React.createElement(PollOptions, {
    post: post,
    votePoll: votePoll,
    options: poll.answers,
    totalVotes: totalVotes,
    disabledPoll: disabledPoll,
    isPollClosed: isPollClosed,
    answerType: poll.answerType,
    isAlreadyVoted: isAlreadyVoted,
    showedAllOptions: showedAllOptions,
    isAuthorSeeingResults: isAuthorSeeingResults
  }), /*#__PURE__*/React.createElement(PollFooter, {
    poll: poll,
    post: post,
    totalVotes: totalVotes,
    isPollClosed: isPollClosed,
    isAlreadyVoted: isAlreadyVoted,
    unvotePoll: unvotePoll,
    disabledPoll: disabledPoll,
    isAuthorSeeingResults: isAuthorSeeingResults,
    setIsAuthorSeeingResults: setIsAuthorSeeingResults
  }));
};
export default PollContent;
//# sourceMappingURL=index.js.map