MCPcopy Create free account
hub / github.com/GooGee/Entity-Builder / SelectMapButton

Function SelectMapButton

src/View/Button/SelectMapButton.tsx:13–36  ·  view source on GitHub ↗
(property: Property<T>)

Source from the content-addressed store, hash-verified

11}
12
13export default function SelectMapButton<T extends ValueType>(property: Property<T>) {
14 return (
15 <select
16 className={"form-select " + (property.className ?? "")}
17 value={property.value}
18 onChange={function (event) {
19 let value: ValueType = event.target.value
20 if (typeof property.value === "number") {
21 value = parseInt(event.target.value)
22 }
23 property.change(value as T)
24 }}
25 >
26 <option disabled={!property.allowEmpty} hidden={!property.allowEmpty} value="">
27 -- {property.verb ?? (property.isAdd ? "add" : "select")} --
28 </option>
29 {property.itemzz.map((item) => (
30 <option key={item[0]} value={item[0]}>
31 {item[1]}
32 </option>
33 ))}
34 </select>
35 )
36}

Callers

nothing calls this directly

Calls 1

changeMethod · 0.65

Tested by

no test coverage detected