docs: add comments to the src/components directory

This commit is contained in:
zhaoying
2026-02-02 16:14:39 +08:00
parent 9a38e8a4a0
commit a191e32f71
55 changed files with 1417 additions and 375 deletions

View File

@@ -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 (