Spaces:
Running
Running
File size: 1,039 Bytes
227c43a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
import React from 'react';
import PropTypes from 'prop-types';
import { Card, Alert } from 'react-bootstrap';
const PluginExplanation = ({ educationalContent, miniExplanation, onLearnMore }) => (
<div className="plugin-explanation">
{miniExplanation && (
<Alert variant="info" className="mb-3">
<div dangerouslySetInnerHTML={{ __html: miniExplanation }} />
{onLearnMore && (
<div className="text-end mt-2">
<button className="btn btn-link btn-sm" onClick={onLearnMore}>
Learn More
</button>
</div>
)}
</Alert>
)}
{educationalContent && (
<Card className="mb-3">
<Card.Body>
<div dangerouslySetInnerHTML={{ __html: educationalContent }} />
</Card.Body>
</Card>
)}
</div>
);
PluginExplanation.propTypes = {
educationalContent: PropTypes.string,
miniExplanation: PropTypes.string,
onLearnMore: PropTypes.func,
};
export default PluginExplanation; |