import { useState } from 'react';
import { useStyles } from './styles';
import Header from './components/Header';
import { SafeAreaView } from 'react-native-safe-area-context';
import Tabs from '../../../../core/components/Tabs';
import PendingPostList from './components/PendingPostList';
import { useAmityElement } from '../../../hooks';
import { ComponentID, ElementID, PageID } from '../../../enums';
const useCommunityPendingRequest = () => {
  const {
    styles
  } = useStyles();
  const [activeTab, setActiveTab] = useState('posts');
  const [pendingPostCount, setPendingPostCount] = useState(0);
  const postsButtonTabElement = useAmityElement({
    pageId: PageID.pending_request_page,
    componentId: ComponentID.WildCardComponent,
    elementId: ElementID.posts_button_tab
  });
  return {
    styles,
    activeTab,
    setActiveTab,
    pendingPostCount,
    setPendingPostCount,
    postsButtonTabElement
  };
};
const CommunityPendingRequest = ({
  community
}) => {
  var _postsButtonTabElemen;
  const {
    styles,
    activeTab,
    setActiveTab,
    pendingPostCount,
    setPendingPostCount,
    postsButtonTabElement
  } = useCommunityPendingRequest();
  return /*#__PURE__*/React.createElement(SafeAreaView, {
    style: styles.container,
    edges: ['top']
  }, /*#__PURE__*/React.createElement(Header, null), /*#__PURE__*/React.createElement(Tabs, {
    variant: "underline",
    activeTab: activeTab,
    onChangeTab: setActiveTab
  }, /*#__PURE__*/React.createElement(Tabs.List, null, /*#__PURE__*/React.createElement(Tabs.Tab, {
    value: "posts",
    testID: postsButtonTabElement.accessibilityId
  }, (_postsButtonTabElemen = postsButtonTabElement.config) === null || _postsButtonTabElemen === void 0 ? void 0 : _postsButtonTabElemen.text, " (", pendingPostCount > 10 ? `10+` : pendingPostCount, ")")), /*#__PURE__*/React.createElement(Tabs.Content, {
    value: "posts"
  }, /*#__PURE__*/React.createElement(PendingPostList, {
    community: community,
    onPendingPostCountChange: setPendingPostCount
  }))));
};
export default CommunityPendingRequest;
//# sourceMappingURL=PendingRequest.js.map