import { Fragment, jsx, jsxs } from "react/jsx-runtime";
import React, { isValidElement } from "react";
import { arrayOf, string, shape, func, bool, node } from "prop-types";
import Text from "../../../Text";
import Box from "../../../Box";
import Attendances from "../Attendances";
import { Content, StyledBox } from "./styles";
import TextWithBadge from "./TextWithBadge";
const Result = ({
  avatar: Avatar,
  attendances = void 0,
  rate = void 0,
  title,
  subTitle = void 0,
  divided = false,
  children = void 0,
  attendancesColor = void 0,
  badgeIcon = void 0
}) => {
  return /* @__PURE__ */ jsxs(StyledBox, { divided, display: "flex", flexDirection: "row", children: [
    Avatar && /* @__PURE__ */ jsx(Fragment, { children: isValidElement(Avatar) ? Avatar : /* @__PURE__ */ jsx(Avatar, {}) }),
    /* @__PURE__ */ jsxs(Content, { children: [
      !!(attendances == null ? void 0 : attendances.length) && /* @__PURE__ */ jsx(
        Attendances,
        {
          attendances,
          rate,
          color: attendancesColor
        }
      ),
      badgeIcon ? /* @__PURE__ */ jsx(TextWithBadge, { badgeIcon, title }) : /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text.Body1, { bold: true, numberOfLines: 1, children: title }) }),
      subTitle && subTitle !== "" && /* @__PURE__ */ jsx(Text.Body2, { numberOfLines: 1, color: "deep", children: subTitle }),
      children
    ] })
  ] });
};
Result.propTypes = {
  /** The component Avatar */
  avatar: node.isRequired,
  /** A list with the attendances */
  attendances: arrayOf(
    shape({
      description: string,
      icon: func
    })
  ),
  /** The evaluation of the partner */
  rate: string,
  /** The main title */
  title: string.isRequired,
  /** The text below the main title */
  subTitle: string,
  /** If it is to show the divide in the bottom */
  divided: bool,
  /** The chidren necessary */
  children: node,
  /** The color of attendences icon and description */
  attendancesColor: string,
  /** The property that defines a whether a badge should be shown and which icon should be rendered */
  badgeIcon: node
};
var Result_default = Result;
export {
  Result_default as default
};
