2020-05-08 19:15:59 +01:00
|
|
|
/*
|
|
|
|
|
Copyright 2015, 2016 OpenMarket Ltd
|
|
|
|
|
Copyright 2020 The Matrix.org Foundation C.I.C.
|
|
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
|
limitations under the License.
|
|
|
|
|
*/
|
|
|
|
|
|
2021-06-29 13:11:58 +01:00
|
|
|
import React, { forwardRef } from "react";
|
2022-03-01 20:42:05 +00:00
|
|
|
import { MatrixEvent } from "matrix-js-sdk/src/matrix";
|
2020-05-08 19:15:59 +01:00
|
|
|
|
2021-06-30 09:00:14 +01:00
|
|
|
interface IProps {
|
|
|
|
|
mxEvent: MatrixEvent;
|
|
|
|
|
children?: React.ReactNode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default forwardRef(({ mxEvent, children }: IProps, ref: React.RefObject<HTMLSpanElement>) => {
|
2020-05-08 19:15:59 +01:00
|
|
|
const text = mxEvent.getContent().body;
|
|
|
|
|
return (
|
2020-08-29 13:51:43 +01:00
|
|
|
<span className="mx_UnknownBody" ref={ref}>
|
2020-05-08 19:15:59 +01:00
|
|
|
{ text }
|
2021-06-18 18:59:22 +01:00
|
|
|
{ children }
|
2020-05-08 19:15:59 +01:00
|
|
|
</span>
|
|
|
|
|
);
|
2020-08-29 13:51:43 +01:00
|
|
|
});
|