1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { Container } from 'react-bootstrap';
4 import { withTranslation } from 'react-i18next';
6 import Outline from './Outline';
7 import { getTranslation } from '../../helpers/Technique';
8 import i18n from '../../i18n';
10 const Detail = ({ technique }) => <Container as="article">
11 <h1>{getTranslation(technique, 'title', i18n.language)}</h1>
12 <Outline technique={technique} />
13 <div dangerouslySetInnerHTML={{
14 __html: getTranslation(technique, 'description', i18n.language),
16 {technique.chapters ? technique.chapters.map(chapter =>
17 <section id={`c${chapter.id}`} key={`c${chapter.id}`}>
18 {chapter.pivot.level ?
20 `h${chapter.pivot.level}`,
22 getTranslation(chapter, 'title', i18n.language),
25 <div dangerouslySetInnerHTML={{
26 __html: getTranslation(chapter, 'description', i18n.language),
33 technique: PropTypes.shape({
34 chapters: PropTypes.arrayOf(PropTypes.shape({
36 description: PropTypes.string,
37 title: PropTypes.string,
41 export default withTranslation()(Detail);