| | |
| | | import { QuartzComponentConstructor, QuartzComponentProps } from "./types" |
| | | import style from "./styles/toc.scss" |
| | | |
| | | |
| | | interface Options { |
| | | layout: 'modern' | 'quartz-3' |
| | | } |
| | | |
| | | const defaultOptions: Options = { |
| | | layout: 'quartz-3' |
| | | } |
| | | |
| | | export default ((opts?: Partial<Options>) => { |
| | | const layout = opts?.layout ?? defaultOptions.layout |
| | | if (layout === "modern") { |
| | | return function() { |
| | | return null // TODO (make this look like nextra) |
| | | } |
| | | } else { |
| | | function TableOfContents({ fileData }: QuartzComponentProps) { |
| | | if (!fileData.toc) { |
| | | return null |
| | |
| | | } |
| | | |
| | | TableOfContents.css = style |
| | | |
| | | export default (() => TableOfContents) satisfies QuartzComponentConstructor |
| | | return TableOfContents |
| | | } |
| | | }) satisfies QuartzComponentConstructor |