import React from 'react';
import Form from '../../forms/form';
import { Card, Fa } from '../../components';
import { OverlayTrigger, Tooltip, Col, Row } from 'react-bootstrap';
import moment from 'moment';
import { getDisplaySchema, getFollowUpType } from './followup-utils';
export default class FollowupDisplay extends React.Component {
constructor(props) {
super(props);
}
renderButtons() {
return (
);
}
renderHeader() {
const followup = this.props.followup;
const followUpType = getFollowUpType(followup.type);
const schema = getDisplaySchema(followup.type);
const doc = followup.data;
if (!schema || !doc) {
return null;
}
var month = ' - ';
month = month + followup.monthOfTreatment;
const subtitle = (
{
moment(doc.date).format('ll')
}
{
followup.monthOfTreatment && {month}
}
);
const header = (
{followup.name}
{subtitle}
{this.renderButtons()}
);
return header;
}
render() {
const followup = this.props.followup;
const schema = getDisplaySchema(followup.type);
const doc = followup.data;
if (!schema || !doc) {
return null;
}
return (
);
}
}
FollowupDisplay.propTypes = {
followup: React.PropTypes.object.isRequired,
onEdit: React.PropTypes.func,
onDelete: React.PropTypes.func
};