2025-05-06 06:45:49 +00:00
|
|
|
import { Link } from 'react-router-dom'
|
|
|
|
|
import classNames from 'classnames'
|
|
|
|
|
import type { PropsWithChildren } from 'react'
|
2025-06-25 20:46:08 +00:00
|
|
|
import HorizontalMenuIcon from './HorizontalMenuIcon'
|
2025-05-06 06:45:49 +00:00
|
|
|
|
|
|
|
|
export type HorizontalMenuNavLinkProps = PropsWithChildren<{
|
2025-06-25 20:46:08 +00:00
|
|
|
path: string
|
|
|
|
|
isExternalLink?: boolean
|
|
|
|
|
className?: string
|
|
|
|
|
icon?: string
|
2025-05-06 06:45:49 +00:00
|
|
|
}>
|
|
|
|
|
|
|
|
|
|
const HorizontalMenuNavLink = ({
|
2025-06-25 20:46:08 +00:00
|
|
|
path,
|
|
|
|
|
children,
|
|
|
|
|
isExternalLink,
|
|
|
|
|
className,
|
|
|
|
|
icon,
|
2025-05-06 06:45:49 +00:00
|
|
|
}: HorizontalMenuNavLinkProps) => {
|
2025-06-25 20:46:08 +00:00
|
|
|
return (
|
2025-06-27 07:26:36 +00:00
|
|
|
<Link
|
2025-09-14 21:00:26 +00:00
|
|
|
className={classNames('flex items-center justify-start', className)}
|
2025-06-27 07:26:36 +00:00
|
|
|
to={path}
|
|
|
|
|
target={isExternalLink ? '_blank' : ''}
|
|
|
|
|
>
|
|
|
|
|
<HorizontalMenuIcon icon={icon || ''} />
|
|
|
|
|
<span>{children}</span>
|
|
|
|
|
</Link>
|
2025-06-25 20:46:08 +00:00
|
|
|
)
|
2025-05-06 06:45:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default HorizontalMenuNavLink
|