1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-26 04:45:22 -04:00
jarv.is/components/HeadingAnchor/HeadingAnchor.tsx

18 lines
441 B
TypeScript

import Link from "../Link";
import { LinkIcon } from "lucide-react";
import type { ComponentPropsWithoutRef } from "react";
export type HeadingAnchorProps = Omit<ComponentPropsWithoutRef<typeof Link>, "href" | "id"> & {
id: string;
};
const HeadingAnchor = ({ id, ...rest }: HeadingAnchorProps) => {
return (
<Link href={`#${id}`} plain {...rest}>
<LinkIcon size="0.8em" />
</Link>
);
};
export default HeadingAnchor;