var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __objRest = (source, exclude) => {
  var target = {};
  for (var prop in source)
    if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
      target[prop] = source[prop];
  if (source != null && __getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(source)) {
      if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
        target[prop] = source[prop];
    }
  return target;
};
import { jsx, jsxs } from "react/jsx-runtime";
import React from "react";
import styled, { withTheme } from "styled-components";
import { ImagePropTypes } from "deprecated-react-native-prop-types";
import { string, number } from "prop-types";
import { Building } from "@gympass/yoga-icons";
import Card from "../../Card";
import Rating from "../../../../Rating";
import Text from "../../../../Text";
import Header from "./Header";
import { Avatar, Placeholder } from "./Avatar";
import Content from "./Content";
const Wrapper = styled(Card)`
  width: 160px;
  min-height: 204px;
`;
const Title = styled(Text)`
  min-height: 40px;

  ${({
  theme: {
    yoga: {
      components: {
        card: {
          gym: { checkIn }
        }
      }
    }
  }
}) => `
    margin-bottom: ${checkIn.title.margin.bottom}px;
    font-weight: ${checkIn.title.font.weight};
  `}
`;
const CheckIn = (_a) => {
  var _b = _a, {
    name,
    address,
    avatar = void 0,
    distance,
    rating,
    theme: {
      yoga: {
        colors: { elements }
      }
    }
  } = _b, rest = __objRest(_b, [
    "name",
    "address",
    "avatar",
    "distance",
    "rating",
    "theme"
  ]);
  return /* @__PURE__ */ jsxs(Wrapper, __spreadProps(__spreadValues({}, rest), { children: [
    /* @__PURE__ */ jsxs(Header, { children: [
      avatar ? /* @__PURE__ */ jsx(Avatar, { source: avatar }) : /* @__PURE__ */ jsx(Placeholder, { children: /* @__PURE__ */ jsx(Building, { width: 24, height: 26, fill: elements.selectionAndIcons }) }),
      /* @__PURE__ */ jsx(Text.Tiny, { children: distance })
    ] }),
    /* @__PURE__ */ jsx(Rating, { value: rating, icon: { size: 18 } }),
    /* @__PURE__ */ jsxs(Content, { children: [
      /* @__PURE__ */ jsx(Title, { numberOfLines: 2, children: name }),
      /* @__PURE__ */ jsx(Text.Tiny, { numberOfLines: 2, children: address })
    ] })
  ] }));
};
CheckIn.propTypes = {
  name: string.isRequired,
  address: string.isRequired,
  /** The same as in source prop of Image react-native component */
  avatar: ImagePropTypes.source,
  distance: string.isRequired,
  rating: number.isRequired
};
CheckIn.displayName = "GymCard.CheckIn";
var CheckIn_default = withTheme(CheckIn);
export {
  CheckIn_default as default
};
