Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F10361482
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
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 dbd02a5..7bb0629 100644
--- a/src/back/jdd-components/faq-component/faq-component.jdd.tsx
+++ b/src/back/jdd-components/faq-component/faq-component.jdd.tsx
@@ -1,76 +1,76 @@
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.Structured({
text: new ComponentArguments.Markdown(),
number: new ComponentArguments.ShortText().setExampleValues(["000-000-000"]),
}),
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(
{
title,
content,
faq,
button,
}: ExtractStructuredComponentArgumentsParsed<typeof component_arguments>,
{ render_markdown }: JDDContext
): 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">
{render_markdown(content.text)}{" "}
<strong>{content.number}</strong>
</div>
</div>
<div>
<div class="faq-container">
- {faq.map((element) => (
- <details class="question-container">
+ {faq.map((element, index) => (
+ <details class="question-container" open={index == 0}>
<summary class="question">{element.question}</summary>
<div class="answer">
- <p>{element.answer}</p>
+ <p>{render_markdown(element.answer)}</p>
</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
Sat, Nov 8, 14:03 (4 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1033172
Default Alt Text
(2 KB)
Attached To
Mode
rAPROXY Assetproxy
Attached
Detach File
Event Timeline
Log In to Comment