mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-21 06:21:17 -04:00
refactor component/page function returns
This commit is contained in:
@@ -25,16 +25,18 @@ const Link = styled(NextLink, {
|
||||
|
||||
export type NoteTitleProps = Pick<NoteFrontMatter, "slug" | "htmlTitle"> & ComponentProps<typeof Title>;
|
||||
|
||||
const NoteTitle = ({ slug, htmlTitle, ...rest }: NoteTitleProps) => (
|
||||
<Title {...rest}>
|
||||
<Link
|
||||
href={{
|
||||
pathname: "/notes/[slug]/",
|
||||
query: { slug },
|
||||
}}
|
||||
dangerouslySetInnerHTML={{ __html: htmlTitle }}
|
||||
/>
|
||||
</Title>
|
||||
);
|
||||
const NoteTitle = ({ slug, htmlTitle, ...rest }: NoteTitleProps) => {
|
||||
return (
|
||||
<Title {...rest}>
|
||||
<Link
|
||||
href={{
|
||||
pathname: "/notes/[slug]/",
|
||||
query: { slug },
|
||||
}}
|
||||
dangerouslySetInnerHTML={{ __html: htmlTitle }}
|
||||
/>
|
||||
</Title>
|
||||
);
|
||||
};
|
||||
|
||||
export default NoteTitle;
|
||||
|
Reference in New Issue
Block a user