2018-07-11 20:22:44 +03:00
|
|
|
<script>
|
2019-11-05 12:36:44 +02:00
|
|
|
const parse = require("../js/helpers/parse");
|
2018-07-11 20:22:44 +03:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: "ParsedMessage",
|
2018-07-12 11:26:12 +03:00
|
|
|
functional: true,
|
2018-07-11 20:22:44 +03:00
|
|
|
props: {
|
2018-07-12 11:41:40 +03:00
|
|
|
text: String,
|
2018-07-11 20:22:44 +03:00
|
|
|
message: Object,
|
2018-07-19 20:44:24 +03:00
|
|
|
network: Object,
|
2018-07-11 20:22:44 +03:00
|
|
|
},
|
|
|
|
render(createElement, context) {
|
2018-07-19 20:44:24 +03:00
|
|
|
return parse(
|
|
|
|
createElement,
|
2019-07-17 10:33:59 +01:00
|
|
|
typeof context.props.text !== "undefined"
|
|
|
|
? context.props.text
|
|
|
|
: context.props.message.text,
|
2018-07-19 20:44:24 +03:00
|
|
|
context.props.message,
|
|
|
|
context.props.network
|
|
|
|
);
|
2018-07-11 20:22:44 +03:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|