Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F1262535
nice-box.jdd.tsx
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
nice-box.jdd.tsx
View Options
import
{
TempstreamJSX
}
from
"tempstream"
;
import
type
{
ExtractStructuredComponentArgumentsValues
,
JDDContext
,
}
from
"@sealcode/jdd"
;
import
{
Component
,
ComponentArguments
}
from
"@sealcode/jdd"
;
import
type
{
Readable
}
from
"stream"
;
const
component_arguments
=
{
title
:
new
ComponentArguments
.
ShortText
(),
content
:
new
ComponentArguments
.
Markdown
(),
images
:
new
ComponentArguments
.
List
(
new
ComponentArguments
.
Structured
({
image
:
new
ComponentArguments
.
Image
(),
alt
:
new
ComponentArguments
.
ShortText
(),
})
),
}
as
const
;
export
class
NiceBox
extends
Component
<
typeof
component_arguments
>
{
getArguments
()
{
return
component_arguments
;
}
async
toHTML
(
{
title
,
content
,
images
,
}
:
ExtractStructuredComponentArgumentsValues
<
typeof
component_arguments
>
,
{
render_markdown
,
render_image
}
:
JDDContext
)
:
Promise
<
Readable
>
{
return
(
<
div
class
=
"nice-box"
>
<
h2
>
{
title
}
<
/h2>
<
div
>
{
render_markdown
(
content
)}
<
/div>
{
images
.
map
((
image
)
=>
render_image
(
image
.
image
,
{
container
:
{
width
:
200
,
height
:
200
,
objectFit
:
"contain"
,
},
alt
:
image
?
.
alt
||
""
,
})
)}
<
/div>
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Fri, Jan 24, 13:19 (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
601600
Default Alt Text
nice-box.jdd.tsx (1 KB)
Attached To
Mode
rPHOTOAPP photo-app-demo
Attached
Detach File
Event Timeline
Log In to Comment