CoastalCommitsPastes/client/components/link/index.tsx

20 lines
470 B
TypeScript
Raw Normal View History

import { useRouter } from "next/router"
import NextLink from "next/link"
import styles from "./link.module.css"
type LinkProps = {
2022-11-10 02:11:36 -05:00
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