CoastalCommitsPastes/client/components/link/index.tsx
2022-11-09 23:11:36 -08:00

19 lines
470 B
TypeScript

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>
const Link = ({ colored, children, ...props }: LinkProps) => {
const className = colored ? `${styles.link} ${styles.color}` : styles.link
return (
<NextLink {...props} className={className}>
{children}
</NextLink>
)
}
export default Link