33 lines
895 B
TypeScript
33 lines
895 B
TypeScript
|
|
"use client";
|
||
|
|
|
||
|
|
import React from "react";
|
||
|
|
import { AutoRegisteringComponentRenderer } from "../../AutoRegisteringComponentRenderer";
|
||
|
|
import { V2ItemRoutingDefinition } from "./index";
|
||
|
|
import { ItemRoutingComponent } from "./ItemRoutingComponent";
|
||
|
|
|
||
|
|
export class ItemRoutingRenderer extends AutoRegisteringComponentRenderer {
|
||
|
|
static componentDefinition = V2ItemRoutingDefinition;
|
||
|
|
|
||
|
|
render(): React.ReactElement {
|
||
|
|
const { formData, isPreview, config, tableName } = this.props as Record<
|
||
|
|
string,
|
||
|
|
unknown
|
||
|
|
>;
|
||
|
|
|
||
|
|
return (
|
||
|
|
<ItemRoutingComponent
|
||
|
|
config={(config as object) || {}}
|
||
|
|
formData={formData as Record<string, unknown>}
|
||
|
|
tableName={tableName as string}
|
||
|
|
isPreview={isPreview as boolean}
|
||
|
|
/>
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
ItemRoutingRenderer.registerSelf();
|
||
|
|
|
||
|
|
if (process.env.NODE_ENV === "development") {
|
||
|
|
ItemRoutingRenderer.enableHotReload();
|
||
|
|
}
|