Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

audio-block.tsx 760B

123456789101112131415161718192021
  1. /**
  2. * @fileoverview AudioBlock component for rendering audio elements in Markdown.
  3. * Extracted from the main markdown renderer for modularity.
  4. * Uses the AudioGallery component to display audio players.
  5. */
  6. import React, { memo } from 'react'
  7. import AudioGallery from '@/app/components/base/audio-gallery'
  8. const AudioBlock: any = memo(({ node }: any) => {
  9. const srcs = node.children.filter((child: any) => 'properties' in child).map((child: any) => (child as any).properties.src)
  10. if (srcs.length === 0) {
  11. const src = node.properties?.src
  12. if (src)
  13. return <AudioGallery key={src} srcs={[src]} />
  14. return null
  15. }
  16. return <AudioGallery key={srcs.join()} srcs={srcs} />
  17. })
  18. AudioBlock.displayName = 'AudioBlock'
  19. export default AudioBlock