TeaWeb/shared/js/ui/react-elements/i18n/index.tsx
2020-06-15 17:16:34 +02:00

11 lines
No EOL
357 B
TypeScript

import * as React from "react";
export class Translatable extends React.Component<{ message: string, children?: never } | { children: string }, any> {
constructor(props) {
super(props);
}
render() {
return /* @tr-ignore */ tr(typeof this.props.children === "string" ? this.props.children : (this.props as any).message);
}
}