Page MenuHomeSealhub

component-input-structured.tsx
No OneTemporary

component-input-structured.tsx

import type { BaseContext } from "koa";
import type { ComponentArgument, Structured } from "@sealcode/jdd";
import type { StatefulPage } from "@sealcode/sealgen";
import { TempstreamJSX } from "tempstream";
import { ComponentInput } from "./component-input.js";
import type { JDDPageState } from "./jdd-page.js";
import type { ComponentPreviewActions } from "./component-preview-actions.js";
export function ComponentInputStructured<
T extends Structured<Record<string, ComponentArgument<unknown>>>
>({
state,
ctx,
arg_path,
arg,
value,
rerender_callback,
page,
}: {
state: JDDPageState;
ctx: BaseContext;
arg_path: string[];
arg: T;
value: Record<string, unknown>;
rerender_callback?: string;
page: StatefulPage<JDDPageState, typeof ComponentPreviewActions>;
}) {
return (
<fieldset>
<legend>{arg_path.at(-1)}</legend>
{Object.entries(arg.structure).map(([arg_name, arg]) => (
<div>
<ComponentInput
{...{
ctx,
state,
arg_path: [...arg_path, arg_name],
arg,
value: value[arg_name],
rerender_callback,
page,
}}
/>
</div>
))}
</fieldset>
);
}

File Metadata

Mime Type
text/x-java
Expires
Fri, Nov 22, 20:15 (19 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
547740
Default Alt Text
component-input-structured.tsx (1 KB)

Event Timeline