import React from 'react';
import { useRouter } from 'next/router'
interface BackLinksProps {
linkList: unknown[]
}
function BackLinks({ linkList }) {
return (
Link to this note
{(linkList != null && linkList.length > 0)
?
<>
{linkList.map(aLink =>
)}
>
: <>
No backlinks found
>}
);
}
interface MDContentProps {
content: unknown
backLinks: unknown[]
handleOpenNewContent: (arg?: unknown) => void
}
function MDContent({ content, backLinks, handleOpenNewContent }: MDContentProps) {
function _handleInternalLinkClick() {
//Processing fetching
//pass result up to parent container
//TODO: handle clicking on internal link, go fetching md content from file then passing it up to parent
handleOpenNewContent(content)
}
useRouter();
return (
);
}
function BackLinksGroup({ links }) {
if (!links?.length) {
return (
No backlinks found
)
}
return (
BackLinks
)
}
export default MDContent;