Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions src/components/IotHub/CategoryFaq.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
import FaqSection from '@components/Pricing/FaqSection.astro';
import FaqJsonLd from '@components/IotHub/FaqJsonLd.astro';
import { getCategoryFaq } from '@data/iot-hub/sections';
import { IOT_HUB_STRINGS } from '@models/iot-hub';

Expand All @@ -14,10 +13,9 @@ const groups = getCategoryFaq(categorySlug);

{
groups && (
<section class="ih-faq" data-iot-hub-faq>
<section class="ih-faq">
<h2 class="ih-faq__title">{IOT_HUB_STRINGS.faqHeading}</h2>
<FaqSection contextId={`iot-hub-${categorySlug}`} categories={groups} />
<FaqJsonLd groups={groups} />
<FaqSection contextId={`iot-hub-${categorySlug}`} categories={groups} jsonLd />
</section>
)
}
Expand All @@ -38,8 +36,3 @@ const groups = getCategoryFaq(categorySlug);
@include iot-hub-section-title;
}
</style>

<script>
import { initIotHubFaq } from '@components/IotHub/iot-hub-faq';
initIotHubFaq();
</script>
32 changes: 0 additions & 32 deletions src/components/IotHub/FaqJsonLd.astro

This file was deleted.

131 changes: 0 additions & 131 deletions src/components/IotHub/iot-hub-faq.ts

This file was deleted.

39 changes: 39 additions & 0 deletions src/components/Pricing/FaqItem.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
import type { FaqItem } from '@data/pricing/types.ts';

// One FAQ row (question toggle + copy-link + collapsible answer). Rendered by
// FaqSection for both the initially-visible items and the "Load more" overflow;
// the two differ only by `hidden`, so the markup lives here in one place.
interface Props {
item: FaqItem;
/** Part of the "Load more" overflow — hidden until the button reveals it. */
hidden?: boolean;
}

const { item, hidden = false } = Astro.props;
---

<div class={`faq-item ${hidden ? 'faq-item--hidden' : ''}`} id={item.id}>
<div class="faq-question">
<h3 class="faq-question-heading">
<button
type="button"
class="faq-question-toggle"
aria-expanded="false"
aria-controls={`${item.id}-answer`}
>{item.question}</button>
</h3>
<button
type="button"
class="faq-copy-link"
data-faq-id={item.id}
aria-label={`Copy link to: ${item.question}`}
></button>
<span class="faq-chevron" aria-hidden="true"></span>
</div>
<div class="faq-answer" id={`${item.id}-answer`}>
<div class="faq-answer-overflow">
<div class="faq-answer-content" set:html={item.answer} />
</div>
</div>
</div>
Loading