import React from 'react';
import { NavLink } from 'react-router-dom';
import styled from 'styled-components';

const LinkIcons = ({ link, title, svg }) => {
  return (
    <>
      <LinkIcon to={link}>
        <svg>
          <use href={`/images/icons.svg#${svg}`}></use>
        </svg>
        <span>{title}</span>
      </LinkIcon>
    </>
  );
};

export default LinkIcons;

const LinkIcon = styled(NavLink)`
  background: transparent;
  font-weight: 500;
  font-family: var(--ff-medium);
  display: flex;
  align-items: center;
  color: var(--co-body);
  padding: 1rem;
  svg {
    width: 18px;
    height: 18px;
  }
  span {
    margin-left: 1rem;
  }
`;
