feat: Add base project structure with API and web components
This commit is contained in:
23
web/src/components/Markdown/Svg.tsx
Normal file
23
web/src/components/Markdown/Svg.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import * as React from 'react';
|
||||
|
||||
interface SvgProps {
|
||||
content: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 渲染SVG内容的组件
|
||||
*/
|
||||
function Svg(props: SvgProps): JSX.Element {
|
||||
const { content } = props;
|
||||
// console.log('Svg', props)
|
||||
|
||||
return React.createElement(
|
||||
'div',
|
||||
{
|
||||
className: 'svg-container',
|
||||
dangerouslySetInnerHTML: { __html: content }
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export default Svg;
|
||||
Reference in New Issue
Block a user