import React from "react";
import PropTypes from "prop-types";
import { makeStyles } from "@mui/styles";
import useTranslation from "../../utils/useTranslation";
import PersonCard from "../../components/PersonCard";
import formatPhone from "../../utils/formatPhone";
const useStyles = makeStyles({
  personCard: {
    "& a": {
      textDecoration: "none !important"
    }
  }
});
function Person(_ref) {
  let {
    isIntern,
    person = {}
  } = _ref;
  const {
    t
  } = useTranslation();
  const classes = useStyles();
  const {
    name,
    phone,
    email,
    division,
    unterrolle,
    kommentar
  } = person;
  return name ? /*#__PURE__*/React.createElement(PersonCard, {
    title: unterrolle && "".concat(unterrolle).concat(kommentar ? " ".concat(kommentar) : ""),
    name: name,
    division: division,
    phone: formatPhone(phone),
    email: isIntern ? email : undefined,
    className: classes.personCard
  }) : /*#__PURE__*/React.createElement("i", null, t("Information nicht verfügbar"));
}
Person.propTypes = {
  person: PropTypes.shape({
    name: PropTypes.string,
    email: PropTypes.string,
    phone: PropTypes.string,
    division: PropTypes.string,
    unterrolle: PropTypes.string,
    kommentar: PropTypes.string
  }),
  isIntern: PropTypes.bool.isRequired
};
export default Person;
//# sourceMappingURL=Person.js.map