app/routes/admin.kb.item.tsx
22 lines and 4 functions in DrDustinEdwards/dustinedwards-info, at commit 1590ba4 on 2026-10-24. This file on GitHub.
Functions
| Function | Lines | Complexity | Covered | CRAP | Mutation |
|---|---|---|---|---|---|
| meta | 9 to 11 | 1 | No data: no coverage report in this map | No data: no coverage report in this map | No data: no mutants in this code |
| loader | 13 to 15 | 1 | No data: no coverage report in this map | No data: no coverage report in this map | No data: no mutants in this code |
| action | 17 to 19 | 1 | No data: no coverage report in this map | No data: no coverage report in this map | No data: no mutants in this code |
| EditItem | 21 to 28 | 3 | No data: no coverage report in this map | No data: no coverage report in this map | No data: no mutants in this code |
Imports
It imports app/components/admin/kb-file-editor.tsx, app/components/admin/kb-form.tsx, app/kb/editor-route.server.ts. No module of this repo imports it.
Source
import { KbFileEditor } from "~/components/admin/kb-file-editor";
import { KbFormEditor } from "~/components/admin/kb-form";
import { kbEditorAction, kbEditorLoader } from "~/kb/editor-route.server";
import type { Route } from "./+types/admin.kb.item";
/* One lab registry item's file, edited and saved through the registry save (docs/KNOWLEDGE-BASE.md, step 3). */
export function meta({ params }: Route.MetaArgs) {
return [{ title: `Edit ${params.kind}/${params.id} · Knowledge Base · Admin` }, { name: "robots", content: "noindex" }];
}
export function loader(args: Route.LoaderArgs) {
return kbEditorLoader(args, { type: "item", kind: args.params.kind, id: args.params.id });
}
export function action(args: Route.ActionArgs) {
return kbEditorAction(args, { type: "item", kind: args.params.kind, id: args.params.id });
}
export default function EditItem({ loaderData, actionData }: Route.ComponentProps) {
const { file, form, view, saved, created } = loaderData;
// The form is the editor; the file itself is behind Advanced (?view=file).
if (view === "form" && form) {
return <KbFormEditor key={file.sha} file={file} form={form} saved={saved} created={created} actionData={actionData} />;
}
return <KbFileEditor key={file.sha} file={file} saved={saved} actionData={actionData} />;
}