import React from 'react'
import { getBoldIconColor } from '../../helper'
import { IIcon } from '../../types'

export default function Icon({ activeColor = 'currentColor', isActive = false, isBoldIcon }: IIcon) {
  return isActive || isBoldIcon ? (
    <svg fill='none' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'>
      <path
        d='M15.6761 4.73433L11.4477 2.34204C10.638 1.88599 9.37024 1.88599 8.56053 2.34204L4.29117 4.75034C2.59815 5.87047 2.5 6.03849 2.5 7.82271V12.1673C2.5 13.9515 2.59815 14.1275 4.32388 15.2637L8.55235 17.656C8.9613 17.888 9.48474 18 10 18C10.5153 18 11.0387 17.888 11.4395 17.656L15.7088 15.2477C17.4019 14.1275 17.5 13.9595 17.5 12.1753V7.82271C17.5 6.03849 17.4019 5.87047 15.6761 4.73433ZM10 12.5993C8.536 12.5993 7.34187 11.4312 7.34187 9.99902C7.34187 8.56684 8.536 7.39866 10 7.39866C11.464 7.39866 12.6581 8.56684 12.6581 9.99902C12.6581 11.4312 11.464 12.5993 10 12.5993Z'
        fill={isBoldIcon ? getBoldIconColor(isActive) : activeColor}
      />
    </svg>
  ) : (
    <svg fill='none' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'>
      <path
        d='M16.2192 7.84503C16.2192 7.44002 16.2186 7.181 16.1986 6.98182C16.18 6.79633 16.1482 6.71356 16.1147 6.6568C16.0774 6.59379 16.0054 6.50769 15.819 6.36324C15.6299 6.21664 15.3707 6.04459 14.9866 5.79097L10.8226 3.43723L10.8199 3.43548C10.6296 3.32649 10.3349 3.25288 10.0027 3.25288C9.67087 3.25291 9.3732 3.32646 9.17739 3.43723L5.01251 5.79097C4.62874 6.04437 4.37003 6.21672 4.18096 6.36324C3.99458 6.50769 3.92256 6.59379 3.88532 6.6568C3.85182 6.71356 3.82 6.79633 3.80136 6.98182C3.78137 7.181 3.78082 7.44002 3.78082 7.84503V12.1471C3.78082 12.5543 3.78131 12.8151 3.80136 13.0156C3.82007 13.2025 3.85164 13.286 3.88532 13.3432C3.92259 13.4065 3.99485 13.4924 4.18096 13.6368C4.36987 13.7833 4.62893 13.9549 5.01251 14.2082L9.17739 16.5628C9.3732 16.6735 9.67087 16.7471 10.0027 16.7471C10.3349 16.7471 10.6296 16.6735 10.8199 16.5645L10.8226 16.5628L14.9866 14.2082C15.3705 13.9547 15.6299 13.7833 15.819 13.6368C16.0054 13.4923 16.0774 13.4062 16.1147 13.3432C16.1482 13.2864 16.18 13.2037 16.1986 13.0182C16.2186 12.819 16.2192 12.56 16.2192 12.155V7.84503ZM11.6461 10.0004C11.6461 9.11101 10.9093 8.39021 10 8.39021C9.09074 8.39021 8.35388 9.11101 8.35388 10.0004C8.35388 10.8899 9.09074 11.6107 10 11.6107C10.9093 11.6107 11.6461 10.8899 11.6461 10.0004ZM12.9269 10.0004C12.9269 11.5816 11.6164 12.8635 10 12.8635C8.38356 12.8635 7.07306 11.5816 7.07306 10.0004C7.07306 8.41925 8.38356 7.13733 10 7.13733C11.6164 7.13733 12.9269 8.41925 12.9269 10.0004ZM17.5 12.155C17.5 12.5359 17.5008 12.8668 17.4732 13.1414C17.4442 13.4294 17.3801 13.7049 17.2231 13.9705C17.0698 14.2298 16.8561 14.4311 16.614 14.6188C16.376 14.8032 16.0659 15.007 15.6931 15.2531C15.6808 15.2612 15.6684 15.2694 15.6556 15.2767L11.4639 17.647L11.463 17.6462C11.0289 17.8938 10.4981 18 10.0027 18C9.50574 18 8.97279 17.8941 8.53609 17.647L4.34441 15.2767C4.3316 15.2694 4.31916 15.2612 4.3069 15.2531C3.93427 15.0071 3.62408 14.8034 3.38603 14.6188C3.1436 14.4308 2.92925 14.2289 2.77599 13.9688C2.61924 13.7027 2.55571 13.4267 2.5268 13.1379C2.49923 12.8624 2.5 12.5301 2.5 12.1471V7.84503C2.5 7.46404 2.4992 7.13316 2.5268 6.85862C2.55577 6.57055 2.61993 6.29511 2.77689 6.02949C2.93018 5.77016 3.14386 5.56887 3.38603 5.3812C3.62401 5.19679 3.93411 4.99305 4.3069 4.7469L4.34441 4.72331L8.53609 2.35297C8.97279 2.10593 9.50574 2.00003 10.0027 2C10.4981 2 11.0289 2.10619 11.463 2.35385L11.4639 2.35297L15.6556 4.72331C15.6684 4.73056 15.6808 4.7388 15.6931 4.7469C16.0659 4.99305 16.376 5.19679 16.614 5.3812C16.8561 5.56887 17.0698 5.77016 17.2231 6.02949C17.3801 6.29511 17.4442 6.57055 17.4732 6.85862C17.5008 7.13316 17.5 7.46404 17.5 7.84503V12.155Z'
        fill='currentColor'
      />
    </svg>
  )
}
