Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F996369
jdd-component.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1022 B
Referenced Files
None
Subscribers
None
jdd-component.ts
View Options
import
{
toKebabCase
,
toPascalCase
}
from
"js-convert-case"
;
export
function
jddComponentTemplate
(
component_name
:
string
)
{
return
`import type { FlatTemplatable } from "tempstream";
import { TempstreamJSX } from "tempstream";
import type {
ExtractStructuredComponentArgumentsParsed,
JDDContext,
} from "@sealcode/jdd";
import { Component, ComponentArguments } from "@sealcode/jdd";
const component_arguments = {
title: new ComponentArguments.ShortText(),
content: new ComponentArguments.Markdown(),
} as const;
export class
${
toPascalCase
(
component_name
)
}
extends Component<typeof component_arguments> {
getArguments() {
return component_arguments;
}
toHTML(
{
title,
content,
}: ExtractStructuredComponentArgumentsParsed<typeof component_arguments>,
{ render_markdown }: JDDContext
): FlatTemplatable {
return (
<div class="
${
toKebabCase
(
component_name
)
}
">
<h2>{title} •
${
toPascalCase
(
component_name
)
}
</h2>
<div>{render_markdown(content)}</div>
</div>
);
}
}
`
;
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Tue, Dec 24, 14:02 (12 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
557215
Default Alt Text
jdd-component.ts (1022 B)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline
Log In to Comment