Page MenuHomeSealhub

component-input-enum.tsx
No OneTemporary

component-input-enum.tsx

import type { Enum } from "@sealcode/jdd";
import { TempstreamJSX } from "tempstream";
import { printArgPath } from "./print-arg-path.js";
export function ComponentInputEnum<State, S extends string, T extends Enum<S>>({
arg_path,
arg,
value,
onchange,
}: {
state: State;
arg_path: string[];
arg: T;
value: string;
onchange?: string;
}) {
return (
<div>
<label>
{arg_path.at(-1) || ""}
<select name={`$${printArgPath(arg_path)}`} onchange={onchange}>
{arg.values.map((v: S) => (
<option value={v} selected={value == v}>
{v}
</option>
))}
</select>
</label>
</div>
);
}

File Metadata

Mime Type
text/x-java
Expires
Fri, Nov 22, 20:14 (18 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
547738
Default Alt Text
component-input-enum.tsx (631 B)

Event Timeline