Files
hudozka/src/components/Menu/ActiveLink.tsx
T
2020-02-22 03:40:14 +03:00

15 lines
369 B
TypeScript

import Link from 'next/link'
export interface ActiveLinkProps {
href?: string
activeStyle?: React.CSSProperties
}
export const ActiveLink: React.FC<ActiveLinkProps> = props => props.href
? (
<Link href={props.href}>
<a>{props.children}</a>
</Link>
) : (
<span style={props.activeStyle}>{props.children}</span>
)