var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
return t;
};
import { gloss } from '@o/gloss';
import * as React from 'react';
import { RoundButtonSmall } from '../buttons/RoundButtonSmall';
import { HorizontalSpace } from '../layout/HorizontalSpace';
import { VerticalSpace } from '../layout/VerticalSpace';
import { DateFormat } from '../text/DateFormat';
import { HighlightText } from '../text/HighlightText';
import { Text } from '../text/Text';
export function ThreadMessage({ date, participants, body }) {
return (React.createElement(Message, null,
React.createElement(Text, { fontWeight: 500, size: 0.9, alpha: 0.8 },
React.createElement(DateFormat, { date: new Date(date) })),
React.createElement(VerticalSpace, { small: true }),
React.createElement(MessageHeader, null, participants
.filter(x => x.type === 'from')
.map(({ name, email }, index) => (React.createElement(React.Fragment, { key: index },
React.createElement(RoundButtonSmall, { key: index, tooltip: email, tooltipProps: {
noHoverOnChildren: false,
} }, name),
React.createElement(HorizontalSpace, null))))),
React.createElement(VerticalSpace, { small: true }),
React.createElement(MailBody, null, body)));
}
const Message = gloss({
padding: 15,
borderBottom: [1, 'dotted', '#eee'],
});
const Paragraph = gloss(HighlightText, {
marginBottom: '0.35rem',
userSelect: 'auto',
});
Paragraph.defaultProps = {
className: 'markdown',
};
const MessageHeader = gloss({
flexFlow: 'row',
});
const Block = gloss({
display: 'block',
'& div': {
display: 'block',
},
});
const MailBody = (_a) => {
var { children } = _a, props = __rest(_a, ["children"]);
return (React.createElement(Text, null,
React.createElement(Block, Object.assign({ className: "gmail-body" }, props, { dangerouslySetInnerHTML: { __html: children } }))));
};
//# sourceMappingURL=ThreadMessage.js.map