Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F21590451
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/back/jdd-components/faq-component/faq-component.jdd.tsx b/src/back/jdd-components/faq-component/faq-component.jdd.tsx
index 1265ec3..c852d83 100644
--- a/src/back/jdd-components/faq-component/faq-component.jdd.tsx
+++ b/src/back/jdd-components/faq-component/faq-component.jdd.tsx
@@ -1,75 +1,75 @@
import type { FlatTemplatable } from "tempstream";
import { TempstreamJSX } from "tempstream";
import type { ComponentToHTMLArgs } from "@sealcode/jdd";
import { Component, ComponentArguments } from "@sealcode/jdd";
const component_arguments = {
title: new ComponentArguments.ShortText(),
content: new ComponentArguments.Structured({
text: new ComponentArguments.Markdown(),
color: new ComponentArguments.Enum(["normal", "accent"]),
}),
accordion_color: new ComponentArguments.Enum(["accent", "accent2"]),
faq: new ComponentArguments.List(
new ComponentArguments.Structured({
question: new ComponentArguments.ShortText(),
answer: new ComponentArguments.Markdown(),
})
),
button: new ComponentArguments.Structured({
buttonText: new ComponentArguments.ShortText().setExampleValues([""]),
buttonLink: new ComponentArguments.ShortText().setExampleValues([""]),
}),
} as const;
export class FaqComponent extends Component<typeof component_arguments> {
getArguments() {
return component_arguments;
}
toHTML({
args: { title, content, faq, button, accordion_color },
jdd_context: { render_markdown, language },
}: ComponentToHTMLArgs<typeof component_arguments>): FlatTemplatable {
const buttonText = button.buttonText.toUpperCase();
return (
<div class="faq-component">
<div class="container">
<div class="title-container">
<div class="title">{title} </div>
<div class={["content", `color-${content.color}`]}>
{render_markdown(language, content.text)}{" "}
</div>
</div>
<div>
<div class="faq-container">
{faq.map((element, index) => (
<details
class={[
"question-container",
`question-container--${accordion_color}`,
]}
open={index == 0}
>
<summary class="question">{element.question}</summary>
<div class="answer">
- <p>{render_markdown(language, element.answer)}</p>
+ {render_markdown(language, element.answer)}
</div>
</details>
))}
</div>
</div>
<div class="button-container">
{button.buttonText === "" ? null : (
<a class="button" href={button.buttonLink}>
{buttonText}
</a>
)}
</div>
</div>
</div>
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Nov 9, 14:22 (49 m, 17 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1182348
Default Alt Text
(2 KB)
Attached To
Mode
rPLAY Sealious playground
Attached
Detach File
Event Timeline