import React from "react";
import { Link } from "react-router-dom";

import { urlForLocal } from "@utils/helper";

import rightArrow from "assets/icons/arrows/arrowRight.svg";

import "./partnerPersonCard.scss";

export const PartnerPersonCard = ({ name, img, userId }) => {
  return (
    <div className="partner-person-card">
      <div className="partner-person-card__img">
        <img src={urlForLocal(img)} alt="avatar" />
      </div>
      <div className="partner-person-card__info">
        <h2 className="partner-person-card__name">{name}</h2>
        <Link
          className="partner-person-card__report"
          to={`/profile/employees/report/${userId}`}
        >
          Подробный отчет
          <div className="partner-person-card__more">
            <img src={rightArrow} alt="arrow" />
          </div>
        </Link>
      </div>
    </div>
  );
};

export default PartnerPersonCard;
