import PropTypes from 'prop-types';
import React from 'react';
-import { Button } from 'react-bootstrap';
+import { Alert, Button } from 'react-bootstrap';
import { useTranslation } from 'react-i18next';
import Icon from '../common/Icon';
import RawHTML from '../common/RawHTML';
+import { hasConcluded } from '../../helpers/Event';
import { getTranslation } from '../../helpers/Technique';
import i18n from '../../i18n';
return <>
<div className="d-flex align-items-center justify-content-between">
- <h1>{event.title}</h1>
+ <h1>
+ {(event.description && getTranslation(event.description, 'title', i18n.language))
+ || event.title}
+ </h1>
{event.description && actions.editContent ?
<Button
className="ms-3"
{event.description ?
<RawHTML html={getTranslation(event.description, 'description', i18n.language)} />
: null}
+ {hasConcluded(event) ?
+ <Alert variant="info">
+ {t('events.concluded')}
+ </Alert>
+ : null}
</>;
};
event: PropTypes.shape({
description: PropTypes.shape({
}),
+ end: PropTypes.string,
title: PropTypes.string,
}),
};