Skip to content

A games launcher for GOG, Amazon and Epic Games for Linux, Windows and macOS.

749 B
Raw Blame
import { ArrowLeft } from 'lucide-react'
import classNames from 'classnames'
import { NavLink } from 'react-router-dom'
import Icon from '../Icon'
import './index.css'

interface BackButtonProps {
  to: string
  label: string
  iconOnly?: boolean
  className?: string
}

export default function BackButton({
  to,
  label,
  iconOnly = false,
  className
}: BackButtonProps) {
  return (
    <NavLink
      to={to}
      title={label}
      aria-label={iconOnly ? label : undefined}
      className={classNames(
        'BackButton',
        { 'BackButton--iconOnly': iconOnly },
        className
      )}
    >
      <Icon glyph={ArrowLeft} size="md" />
      {!iconOnly && <span className="BackButton__label">{label}</span>}
    </NavLink>
  )
}