Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F969360
component-input-enum.tsx
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
631 B
Referenced Files
None
Subscribers
None
component-input-enum.tsx
View Options
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
Details
Attached
Mime Type
text/x-java
Expires
Fri, Nov 22, 20:14 (1 d, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
547738
Default Alt Text
component-input-enum.tsx (631 B)
Attached To
Mode
rPLAY Sealious playground
Attached
Detach File
Event Timeline
Log In to Comment