mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-26 18:08:28 -04:00
22 lines
539 B
TypeScript
22 lines
539 B
TypeScript
import clsx from "clsx";
|
|
import Link from "../Link";
|
|
import type { ComponentPropsWithoutRef } from "react";
|
|
|
|
import styles from "./PageTitle.module.css";
|
|
|
|
export type PageTitleProps = ComponentPropsWithoutRef<"h1"> & {
|
|
canonical: string;
|
|
};
|
|
|
|
const PageTitle = ({ canonical, className, children, ...rest }: PageTitleProps) => {
|
|
return (
|
|
<h1 className={clsx(styles.title, className)} {...rest}>
|
|
<Link href={canonical} plain className={styles.slug}>
|
|
{children}
|
|
</Link>
|
|
</h1>
|
|
);
|
|
};
|
|
|
|
export default PageTitle;
|