mirror of
https://github.com/wassname/talk.git
synced 2026-07-10 22:34:54 +08:00
29 lines
847 B
JavaScript
29 lines
847 B
JavaScript
import React from 'react';
|
|
import cn from 'classnames';
|
|
import styles from './QuestionBox.css';
|
|
import {Icon} from 'coral-ui';
|
|
import Markdown from 'coral-framework/components/Markdown';
|
|
import DefaultQuestionBoxIcon from './DefaultQuestionBoxIcon';
|
|
|
|
const QuestionBox = ({content, icon, className, children}) => (
|
|
<div className={cn(styles.qbInfo, 'questionbox-info', className)}>
|
|
{
|
|
icon === 'default' ? (
|
|
<div className={cn(styles.qbIconContainer)}>
|
|
<DefaultQuestionBoxIcon />
|
|
</div>
|
|
) : (
|
|
<div className={cn(styles.qbIconContainer)}>
|
|
<Icon name={icon} className={cn(styles.icon)} />
|
|
</div>
|
|
)
|
|
}
|
|
<div className={cn(styles.qbContent, 'questionbox-content')}>
|
|
<Markdown content={content} />
|
|
</div>
|
|
{children}
|
|
</div>
|
|
);
|
|
|
|
export default QuestionBox;
|