---
import { Boolify } from "../lib/boolify";
import c from "../lib/config";


const { href, text, icon } = Astro.props;
const useIcons = Boolify(c.USEICONS);
---

{
  useIcons && (
    <a href={href} target="_blank" rel="noopener noreferrer">
      <i class={`fa${(icon ? icon : text.toLowerCase()) == "envelope" ? '' : '-brands'} fa-${icon ? icon : text.toLowerCase()} fa-2xl`} />
    </a>
  )
}
{
  !useIcons && (
    <a href={href} target="_blank" rel="noopener noreferrer">
      {text}
    </a>
  )
}
