feat: Add base project structure with API and web components
This commit is contained in:
22
web/src/components/Markdown/VideoBlock.tsx
Normal file
22
web/src/components/Markdown/VideoBlock.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { memo } from 'react'
|
||||
|
||||
import type { FC } from 'react'
|
||||
|
||||
interface VideoBlockProps {
|
||||
node: {
|
||||
children: { properties: { src: string } }[]
|
||||
}
|
||||
}
|
||||
const VideoBlock: FC<VideoBlockProps> = (props) => {
|
||||
// console.log('VideoBlock', props)
|
||||
const { children } = props.node;
|
||||
const srcs = children.map(item => item.properties?.src).filter(item => item)
|
||||
|
||||
return (
|
||||
<>
|
||||
{srcs.map(src => <video key={src} src={src} controls />)}
|
||||
</>
|
||||
|
||||
)
|
||||
}
|
||||
export default memo(VideoBlock)
|
||||
Reference in New Issue
Block a user