docs: add comments to the src/components directory
This commit is contained in:
@@ -1,15 +1,31 @@
|
||||
import { memo } from 'react'
|
||||
/*
|
||||
* @Author: ZhaoYing
|
||||
* @Date: 2026-02-02 15:14:59
|
||||
* @Last Modified by: ZhaoYing
|
||||
* @Last Modified time: 2026-02-02 15:14:59
|
||||
*/
|
||||
/**
|
||||
* AudioBlock Component
|
||||
*
|
||||
* Renders audio elements from markdown nodes.
|
||||
* Extracts audio source URLs and creates HTML audio players with controls.
|
||||
*
|
||||
* @component
|
||||
*/
|
||||
|
||||
import type { FC } from 'react'
|
||||
import { memo, type FC } from 'react'
|
||||
|
||||
/** Props interface for AudioBlock component */
|
||||
interface AudioBlockProps {
|
||||
node: {
|
||||
children: { properties: { src: string } }[]
|
||||
}
|
||||
}
|
||||
|
||||
/** Audio block component that renders audio elements from markdown nodes */
|
||||
const AudioBlock: FC<AudioBlockProps> = (props) => {
|
||||
// console.log('AudioBlock', props)
|
||||
const { children } = props.node;
|
||||
/** Extract audio source URLs from node children and filter out empty values */
|
||||
const srcs = children.map(item => item.properties?.src).filter(item => item)
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user