feat: add custom code tag to markdown

This commit is contained in:
Stevan Freeborn
2023-04-09 14:50:50 -05:00
parent ae44fe7e07
commit 4c6257012d
12 changed files with 189 additions and 115 deletions
+6 -6
View File
@@ -1,10 +1,10 @@
'use client';
import { useState } from 'react';
import { DocsStructure } from '../types/types.js';
import { Doc, DocsStructure } from '../types/types.js';
import styles from './SideBar.module.css';
function TreeNode({ doc }: { doc: DocsStructure }) {
function TreeNode({ doc }: { doc: Doc }) {
const [isExpanded, setIsExpanded] =
useState<boolean>(true);
@@ -62,7 +62,7 @@ function TreeNode({ doc }: { doc: DocsStructure }) {
);
}
function ListTree({ docs }: { docs: DocsStructure[] }) {
function ListTree({ docs }: { docs: Doc[] }) {
return (
<ul className={styles.list}>
{docs.map(d => (
@@ -76,8 +76,8 @@ export default function SideBar({
versionOne,
versionTwo,
}: {
versionOne: DocsStructure[];
versionTwo: DocsStructure[];
versionOne: DocsStructure;
versionTwo: DocsStructure;
}) {
return (
<div className={styles.container}>
@@ -85,7 +85,7 @@ export default function SideBar({
<span className={styles.onspring}>Onspring</span>{' '}
<span className={styles.api}>API</span>
</h1>
<ListTree docs={versionTwo} />
<ListTree docs={versionTwo.docs} />
</div>
);
}