faq.tsx 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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
  16. d="M12.5 11.5H19V12.5H12.5V19H11.5V12.5H5V11.5H11.5V5H12.5V11.5Z"
  17. fill="currentColor"
  18. />
  19. </svg>
  20. <svg
  21. data-slot="faq-icon-minus"
  22. width="24"
  23. height="24"
  24. viewBox="0 0 24 24"
  25. fill="currentColor"
  26. xmlns="http://www.w3.org/2000/svg"
  27. >
  28. <path d="M5 11.5H19V12.5H5Z" fill="currentColor" />
  29. </svg>
  30. <div data-slot="faq-question-text">{props.question}</div>
  31. </Collapsible.Trigger>
  32. <Collapsible.Content data-slot="faq-answer">{props.children}</Collapsible.Content>
  33. </Collapsible>
  34. )
  35. }