faq.tsx 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. import { Collapsible } from "@kobalte/core/collapsible"
  2. import { ParentProps } from "solid-js"
  3. export function Faq(props: ParentProps & { question: string }) {
  4. return (
  5. <Collapsible data-slot="faq-item">
  6. <Collapsible.Trigger data-slot="faq-question">
  7. <svg
  8. data-slot="faq-icon-plus"
  9. width="24"
  10. height="24"
  11. viewBox="0 0 24 24"
  12. fill="currentColor"
  13. xmlns="http://www.w3.org/2000/svg"
  14. >
  15. <path d="M12.5 11.5H19V12.5H12.5V19H11.5V12.5H5V11.5H11.5V5H12.5V11.5Z" fill="currentColor" />
  16. </svg>
  17. <svg
  18. data-slot="faq-icon-minus"
  19. width="24"
  20. height="24"
  21. viewBox="0 0 24 24"
  22. fill="currentColor"
  23. xmlns="http://www.w3.org/2000/svg"
  24. >
  25. <path d="M5 11.5H19V12.5H5Z" fill="currentColor" />
  26. </svg>
  27. <div data-slot="faq-question-text">{props.question}</div>
  28. </Collapsible.Trigger>
  29. <Collapsible.Content data-slot="faq-answer">{props.children}</Collapsible.Content>
  30. </Collapsible>
  31. )
  32. }