mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-28 09:18:45 +00:00
Use spyglass DocAndNode to store current file data
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import type { DocAndNode } from '@spyglassmc/core'
|
||||
import { useErrorBoundary } from 'preact/hooks'
|
||||
import { useLocale } from '../../contexts/index.js'
|
||||
import type { FileModel } from '../../services/index.js'
|
||||
|
||||
type TreePanelProps = {
|
||||
model: FileModel | undefined,
|
||||
docAndNode: DocAndNode,
|
||||
onError: (message: string) => unknown,
|
||||
}
|
||||
export function Tree({ model, onError }: TreePanelProps) {
|
||||
export function Tree({ onError }: TreePanelProps) {
|
||||
const { lang } = useLocale()
|
||||
if (!model || lang === 'none') return <></>
|
||||
if (lang === 'none') return <></>
|
||||
|
||||
const [error] = useErrorBoundary(e => {
|
||||
onError(`Error rendering the tree: ${e.message}`)
|
||||
|
||||
Reference in New Issue
Block a user