mirror of
https://github.com/thelounge/thelounge
synced 2024-11-23 04:23:13 +00:00
dd05ee3a65
Co-authored-by: Eric Nemchik <eric@nemchik.com> Co-authored-by: Pavel Djundik <xPaw@users.noreply.github.com>
22 lines
606 B
Vue
22 lines
606 B
Vue
<script lang="ts">
|
|
import {defineComponent, PropType, h} from "vue";
|
|
import parse from "../js/helpers/parse";
|
|
import type {ClientMessage, ClientNetwork} from "../js/types";
|
|
|
|
export default defineComponent({
|
|
name: "ParsedMessage",
|
|
functional: true,
|
|
props: {
|
|
text: String,
|
|
message: {type: Object as PropType<ClientMessage | string>, required: false},
|
|
network: {type: Object as PropType<ClientNetwork>, required: false},
|
|
},
|
|
render(context) {
|
|
return parse(
|
|
typeof context.text !== "undefined" ? context.text : context.message.text,
|
|
context.message,
|
|
context.network
|
|
);
|
|
},
|
|
});
|
|
</script>
|