Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

video-block.tsx 753B

123456789101112131415161718192021
  1. /**
  2. * @fileoverview VideoBlock component for rendering video elements in Markdown.
  3. * Extracted from the main markdown renderer for modularity.
  4. * Uses the VideoGallery component to display videos.
  5. */
  6. import React, { memo } from 'react'
  7. import VideoGallery from '@/app/components/base/video-gallery'
  8. const VideoBlock: 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 <VideoGallery key={src} srcs={[src]} />
  14. return null
  15. }
  16. return <VideoGallery key={srcs.join()} srcs={srcs} />
  17. })
  18. VideoBlock.displayName = 'VideoBlock'
  19. export default VideoBlock