import { Text } from 'react-native';
import { memo, useCallback } from 'react';
import { ComponentID, ElementID, PageID } from '../../../../../enums';
import useConfig from '../../../../../hooks/useConfig';
import { useUiKitConfig } from '../../../../../hooks';
import { useStyles } from './styles/styles';
import { useBehaviour } from '../../../../../providers/BehaviourProvider';
import { useNavigation } from '@react-navigation/native';
const CreateCommunityButton = () => {
  const {
    excludes
  } = useConfig();
  const styles = useStyles();
  const navigation = useNavigation();
  const {
    AmityEmptyNewsFeedComponent
  } = useBehaviour();
  const [text] = useUiKitConfig({
    keys: ['text'],
    page: PageID.social_home_page,
    component: ComponentID.empty_newsfeed,
    element: ElementID.create_community_button
  });
  const onPressCreateCommunity = useCallback(() => {
    if (AmityEmptyNewsFeedComponent.onPressCreateCommunity) return AmityEmptyNewsFeedComponent.onPressCreateCommunity();
    navigation.navigate('CreateCommunity');
  }, [AmityEmptyNewsFeedComponent, navigation]);
  if (excludes.includes('social_home_page/empty_newsfeed/create_community_button')) return null;
  return /*#__PURE__*/React.createElement(Text, {
    style: styles.createCommunityBtnText,
    onPress: onPressCreateCommunity
  }, text ?? 'Create Community');
};
export default /*#__PURE__*/memo(CreateCommunityButton);
//# sourceMappingURL=CreateCommunityButton.js.map