import * as React from 'react'; import { PageFrontMatter } from '../../models/PageFrontMatter'; import { Link } from '../Link/Link'; import { Section } from '../Link/Section'; export interface ISidebarProps { items: PageFrontMatter[]; } export const Sidebar: React.FunctionComponent = ({ items }: React.PropsWithChildren) => { const sorted = items?.sort((a, b) => { return (a.weight || 99) - (b.weight || 99); }) || []; const getLinks = (item: PageFrontMatter) => { const { content } = item; const links = Array.from(content.matchAll(/^## (.*$)/gim)); if (!links || links.length === 0) { return null; } return ( ); } return ( ); };