import { Fragment, memo } from 'react';
import ContentLoader, { Rect } from 'react-content-loader/native';
import { useStyles } from './styles';
import { View } from 'react-native';
import { getSkeletonBackgrounColor } from '../../../../../../core/utils/color';
import { Path } from 'react-native-svg';
import CommunityListSkeleton from '../../../../../components/CommunityListSkeleton/CommunityListSkeleton';
const ExploreLoadingSkeleton = ({
  themeStyles
}) => {
  const styles = useStyles();
  const {
    backgroundColor,
    foregroundColor
  } = getSkeletonBackgrounColor(themeStyles);
  const renderCategoriesSkeleton = () => {
    return /*#__PURE__*/React.createElement(View, {
      style: styles.categoriesContainers
    }, /*#__PURE__*/React.createElement(ContentLoader, {
      height: 36,
      width: 400,
      speed: 1,
      viewBox: "0 0 400 36",
      backgroundColor: backgroundColor,
      foregroundColor: foregroundColor
    }, Array.from({
      length: 4
    }, (_, index) => {
      return /*#__PURE__*/React.createElement(Rect, {
        key: index,
        x: index !== 0 ? index * (90 + 8) : 0,
        y: "0",
        rx: "20",
        ry: "20",
        width: "90",
        height: "36"
      });
    })));
  };
  const renderRecommendedCommunitiesSkeleton = () => {
    // Title
    const titleHeight = 44;
    // Card
    const height = 134;
    const width = 268;
    const detailHeight = 88;
    const radius = 8;
    const borderWidth = 1;
    const gap = 12;
    // Card content
    const marginLeft = 12;
    return /*#__PURE__*/React.createElement(View, {
      style: styles.categoriesContainers
    }, /*#__PURE__*/React.createElement(ContentLoader, {
      height: height + detailHeight + titleHeight,
      width: 400,
      speed: 1,
      viewBox: `0 0 400 ${height + detailHeight + titleHeight}`,
      backgroundColor: backgroundColor,
      foregroundColor: foregroundColor
    }, /*#__PURE__*/React.createElement(Rect, {
      x: "0",
      y: "0",
      width: "156",
      height: "12",
      rx: "6",
      ry: "6"
    }), Array.from({
      length: 2
    }, (_, index) => {
      return /*#__PURE__*/React.createElement(Fragment, {
        key: index
      }, /*#__PURE__*/React.createElement(Rect, {
        x: index * (width + gap),
        y: titleHeight,
        width: width,
        height: height + detailHeight,
        rx: "8",
        ry: "8"
      }), /*#__PURE__*/React.createElement(Path, {
        d: `
                  M ${index * (width + gap) + borderWidth},${height + titleHeight}
                  L ${(index + 1) * width - borderWidth},${height + titleHeight}
                  L ${(index + 1) * width - borderWidth},${height + detailHeight - radius + titleHeight - borderWidth}
                  Q ${(index + 1) * width - borderWidth},${height + detailHeight + titleHeight - borderWidth} ${(index + 1) * width - radius},${height + detailHeight + titleHeight - borderWidth}
                  L ${index * (width + gap) + radius + borderWidth},${height + detailHeight + titleHeight - borderWidth}
                  Q ${index * (width + gap) + borderWidth},${height + detailHeight + titleHeight - borderWidth} ${index * (width + gap) + borderWidth},${height + detailHeight - radius + titleHeight - borderWidth}
                  L ${index * (width + gap) + borderWidth},${height + titleHeight}
                `
      }), /*#__PURE__*/React.createElement(Rect, {
        x: index * (width + marginLeft + borderWidth) + gap,
        y: 151 + titleHeight,
        width: "90",
        height: "10",
        rx: "6",
        ry: "6"
      }), /*#__PURE__*/React.createElement(Rect, {
        x: index * (width + marginLeft + borderWidth) + gap,
        y: 177 + titleHeight,
        width: "164",
        height: "8",
        rx: "6",
        ry: "6"
      }), /*#__PURE__*/React.createElement(Rect, {
        x: index * (width + marginLeft + borderWidth) + gap,
        y: 195 + titleHeight,
        width: "196",
        height: "8",
        rx: "6",
        ry: "6"
      }));
    })));
  };
  const renderTrendingCommunitiesSkeleton = () => {
    return /*#__PURE__*/React.createElement(View, {
      style: styles.trendingCommunitiesContainer
    }, /*#__PURE__*/React.createElement(CommunityListSkeleton, {
      themeStyle: themeStyles
    }));
  };
  return /*#__PURE__*/React.createElement(React.Fragment, null, renderCategoriesSkeleton(), renderRecommendedCommunitiesSkeleton(), renderTrendingCommunitiesSkeleton());
};
export default /*#__PURE__*/memo(ExploreLoadingSkeleton);
//# sourceMappingURL=ExploreLoadingSkeleton.js.map