1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-27 05:18:28 -04:00
jarv.is/components/PageTitle/PageTitle.tsx

27 lines
569 B
TypeScript

import { memo } from "react";
import { useRouter } from "next/router";
import Link from "next/link";
import classNames from "classnames";
import type { ReactNode } from "react";
import styles from "./PageTitle.module.css";
type Props = {
children: ReactNode;
className?: string;
};
const PageTitle = ({ children, className }: Props) => {
const router = useRouter();
return (
<h1 className={classNames(styles.title, className)}>
<Link href={router.asPath}>
<a>{children}</a>
</Link>
</h1>
);
};
export default memo(PageTitle);