1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { Alert, Button } from 'react-bootstrap';
4 import { useTranslation } from 'react-i18next';
6 import Icon from '../common/Icon';
7 import RawHTML from '../common/RawHTML';
8 import { hasConcluded } from '../../helpers/Event';
9 import { getTranslation } from '../../helpers/Technique';
10 import i18n from '../../i18n';
12 const Detail = ({ actions, event }) => {
13 const { t } = useTranslation();
16 <div className="d-flex align-items-center justify-content-between">
18 {(event.description && getTranslation(event.description, 'title', i18n.language))
21 {event.description && actions.editContent ?
24 onClick={() => actions.editContent(event.description)}
26 title={t('button.edit')}
27 variant="outline-secondary"
29 <Icon.EDIT title="" />
34 <RawHTML html={getTranslation(event.description, 'description', i18n.language)} />
36 {hasConcluded(event) ?
37 <Alert variant="info">
38 {t('events.concluded')}
45 actions: PropTypes.shape({
46 editContent: PropTypes.func,
48 event: PropTypes.shape({
49 description: PropTypes.shape({
51 end: PropTypes.string,
52 title: PropTypes.string,
56 export default Detail;