move error component to standalone

This commit is contained in:
Chris Kruining 2025-02-20 16:10:20 +11:00
parent 2b4aac7189
commit 5731ba62d0
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
6 changed files with 40 additions and 34 deletions

View file

@ -1,8 +1,9 @@
import { ParentProps } from "solid-js";
import { ErrorBoundary, ParentProps } from "solid-js";
import { Menu } from "~/features/menu";
import { createCommand } from "~/features/command";
import { useNavigate } from "@solidjs/router";
import { ErrorComp } from "~/components/error";
export default function Experimental(props: ParentProps) {
const navigate = useNavigate();
@ -19,6 +20,8 @@ export default function Experimental(props: ParentProps) {
<Menu.Item command={goTo.withLabel('formatter').with('formatter')} />
</Menu.Root>
{props.children}
<ErrorBoundary fallback={e => <ErrorComp error={e} />}>
{props.children}
</ErrorBoundary>
</>;
}