CoastalCommitsPastes/client/components/link/index.tsx

20 lines
471 B
TypeScript
Raw Normal View History

import { useRouter } from "next/router"
import NextLink from "next/link"
import styles from "./link.module.css"
type LinkProps = {
colored?: boolean,
children: React.ReactNode
} & React.ComponentProps<typeof NextLink>
2022-11-09 21:38:05 -05:00
const Link = ({ colored, children, ...props }: LinkProps) => {
const className = colored ? `${styles.link} ${styles.color}` : styles.link
return (
2022-11-09 21:38:05 -05:00
<NextLink {...props} className={className}>
{children}
</NextLink>
)
}
export default Link