mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-27 18:50:29 -04:00
25 lines
476 B
TypeScript
25 lines
476 B
TypeScript
import { memo } from "react";
|
|
import { useRouter } from "next/router";
|
|
import Link from "next/link";
|
|
import type { ReactNode } from "react";
|
|
|
|
import styles from "./PageTitle.module.css";
|
|
|
|
type Props = {
|
|
children: ReactNode;
|
|
};
|
|
|
|
const PageTitle = ({ children }: Props) => {
|
|
const router = useRouter();
|
|
|
|
return (
|
|
<h1 className={styles.title}>
|
|
<Link href={router.asPath}>
|
|
<a>{children}</a>
|
|
</Link>
|
|
</h1>
|
|
);
|
|
};
|
|
|
|
export default memo(PageTitle);
|