import {
  createStyles
} from "./chunk-2RJFJ6FG.mjs";
import {
  ProfileComponentFragment
} from "./chunk-HPGIKUBT.mjs";

// tmp-babel/profiles/native/ProfileComponent/index.js
import React from "react";
import { Button } from "@baseapp-frontend/design-system/components/native/buttons";
import { EditIcon, ShareIcon } from "@baseapp-frontend/design-system/components/native/icons";
import { Text } from "@baseapp-frontend/design-system/components/native/typographies";
import { PageViewWithHeader, View } from "@baseapp-frontend/design-system/components/native/views";
import { useTheme } from "@baseapp-frontend/design-system/providers/native";
import { useRouter } from "expo-router";
import { Image } from "react-native";
import { useFragment } from "react-relay";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
var ProfileComponent = function ProfileComponent2(_ref) {
  var _profile$bannerImage, _profile$image, _profile$urlPath;
  var profileRef = _ref.profile;
  var theme = useTheme();
  var styles = createStyles(theme);
  var profile = useFragment(ProfileComponentFragment, profileRef);
  var router = useRouter();
  return /* @__PURE__ */ _jsxs(PageViewWithHeader, {
    style: styles.container,
    children: [/* @__PURE__ */ _jsxs(View, {
      style: styles.headerContainer,
      children: [/* @__PURE__ */ _jsx(Image, {
        source: {
          uri: profile === null || profile === void 0 || (_profile$bannerImage = profile.bannerImage) === null || _profile$bannerImage === void 0 ? void 0 : _profile$bannerImage.url
        },
        style: styles.bannerImage
      }), /* @__PURE__ */ _jsx(Image, {
        source: {
          uri: profile === null || profile === void 0 || (_profile$image = profile.image) === null || _profile$image === void 0 ? void 0 : _profile$image.url
        },
        style: styles.profileImage
      })]
    }), /* @__PURE__ */ _jsxs(View, {
      style: styles.infoContainer,
      children: [/* @__PURE__ */ _jsxs(View, {
        style: styles.nameContainer,
        children: [/* @__PURE__ */ _jsx(Text, {
          variant: "h6",
          color: "high",
          children: profile === null || profile === void 0 ? void 0 : profile.name
        }), /* @__PURE__ */ _jsxs(Text, {
          variant: "body2",
          color: "low",
          children: ["@", profile === null || profile === void 0 || (_profile$urlPath = profile.urlPath) === null || _profile$urlPath === void 0 || (_profile$urlPath = _profile$urlPath.path) === null || _profile$urlPath === void 0 ? void 0 : _profile$urlPath.replace("/", "")]
        })]
      }), /* @__PURE__ */ _jsxs(View, {
        style: styles.statsContainer,
        children: [/* @__PURE__ */ _jsxs(View, {
          style: styles.statContainer,
          children: [/* @__PURE__ */ _jsx(Text, {
            variant: "h6",
            color: "high",
            children: profile === null || profile === void 0 ? void 0 : profile.followersCount
          }), /* @__PURE__ */ _jsx(Text, {
            variant: "body2",
            color: "low",
            children: "Followers"
          })]
        }), /* @__PURE__ */ _jsxs(View, {
          style: [styles.statContainer, styles.leftBorder],
          children: [/* @__PURE__ */ _jsx(Text, {
            variant: "h6",
            color: "high",
            children: profile === null || profile === void 0 ? void 0 : profile.followingCount
          }), /* @__PURE__ */ _jsx(Text, {
            variant: "body2",
            color: "low",
            children: "Following"
          })]
        })]
      }), /* @__PURE__ */ _jsx(Text, {
        style: styles.biography,
        variant: "caption",
        color: "low",
        children: profile === null || profile === void 0 ? void 0 : profile.biography
      }), /* @__PURE__ */ _jsxs(View, {
        style: styles.buttonContainer,
        children: [/* @__PURE__ */ _jsx(Button, {
          size: "medium",
          mode: "soft",
          color: "inherit",
          icon: EditIcon,
          style: styles.button,
          contentStyle: styles.buttonContent,
          onPress: function onPress() {
            router.push("/profile-settings");
          },
          children: "Edit Profile"
        }), /* @__PURE__ */ _jsx(Button, {
          size: "medium",
          mode: "soft",
          color: "inherit",
          icon: ShareIcon,
          style: styles.button,
          contentStyle: styles.buttonContent,
          children: "Share profile"
        })]
      })]
    })]
  });
};
var ProfileComponent_default = ProfileComponent;

export {
  ProfileComponent_default
};
//# sourceMappingURL=chunk-4SENMLJN.mjs.map