2020-12-14 18:52:43 +00:00
|
|
|
import React, {Component} from 'react';
|
|
|
|
import {Card, Col, Row} from 'react-bootstrap';
|
2020-12-12 20:18:25 +00:00
|
|
|
|
|
|
|
type CardProps = {
|
|
|
|
title: string,
|
2020-12-13 19:32:33 +00:00
|
|
|
content: string,
|
|
|
|
update: Date
|
2020-12-12 20:18:25 +00:00
|
|
|
}
|
|
|
|
|
2020-12-13 11:27:50 +00:00
|
|
|
|
2020-12-13 19:32:33 +00:00
|
|
|
class HCard extends Component<CardProps> {
|
2020-12-13 11:27:50 +00:00
|
|
|
constructor(props: CardProps) {
|
|
|
|
super(props)
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
2020-12-14 18:52:43 +00:00
|
|
|
<Card bg="light" style={{minWidth: "15rem"}} className="mx-auto">
|
2020-12-13 11:27:50 +00:00
|
|
|
<Row className="no-gutters">
|
|
|
|
<Col md={7} className="border-right my-auto">
|
|
|
|
<h3 className="text-center">{this.props.title}</h3>
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
<Col md={5}>
|
|
|
|
<Card.Body>
|
|
|
|
<Card.Text className="text-center">
|
|
|
|
{this.props.content}
|
|
|
|
</Card.Text>
|
|
|
|
</Card.Body>
|
|
|
|
</Col>
|
|
|
|
</Row>
|
|
|
|
<Card.Text className="border-top text-center">
|
2020-12-14 18:52:43 +00:00
|
|
|
<small className="text-muted my-auto mx-2">Last
|
|
|
|
updated {this.props.update.toLocaleTimeString('en-GB')}</small>
|
2020-12-13 11:27:50 +00:00
|
|
|
</Card.Text>
|
|
|
|
</Card>);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default HCard;
|