import React from "react"

import { CustomLink } from "@/components"
import { getLinkWithPathPrefix } from "@/utils"

interface IProps {
  link?: string
  children: React.ReactNode
}

const MenuLink: React.FC<IProps> = ({ link, children }) => {
  return !!link ? (
    <CustomLink className="a-dark" linkTo={getLinkWithPathPrefix(link)}>
      {children}
    </CustomLink>
  ) : (
    <>{children}</>
  )
}

export default MenuLink
