1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { Button } from 'react-bootstrap';
4 import { useTranslation } from 'react-i18next';
6 import Icon from '../common/Icon';
7 import RawHTML from '../common/RawHTML';
8 import { getTranslation } from '../../helpers/Technique';
9 import i18n from '../../i18n';
11 const Detail = ({ actions, event }) => {
12 const { t } = useTranslation();
15 <div className="d-flex align-items-center justify-content-between">
16 <h1>{event.title}</h1>
17 {event.description && actions.editContent ?
20 onClick={() => actions.editContent(event.description)}
22 title={t('button.edit')}
23 variant="outline-secondary"
25 <Icon.EDIT title="" />
30 <RawHTML html={getTranslation(event.description, 'description', i18n.language)} />
36 actions: PropTypes.shape({
37 editContent: PropTypes.func,
39 event: PropTypes.shape({
40 description: PropTypes.shape({
42 title: PropTypes.string,
46 export default Detail;