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="partnerPersonCard">
      <div className="partnerPersonCard__img">
        <img src={urlForLocal(img)} alt="avatar" />
      </div>
      <div className="partnerPersonCard__info">
        <h2 className="partnerPersonCard__name">{name}</h2>
        <Link
          className="partnerPersonCard__report"
          to={`/profile/employees/report/${userId}`}
        >
          Подробный отчет
          <div className="partnerPersonCard__more">
            <img src={rightArrow} alt="arrow" />
          </div>
        </Link>
      </div>
    </div>
  );
};

export default PartnerPersonCard;
