16
common/resources/client/i18n/mixed-text.tsx
Executable file
16
common/resources/client/i18n/mixed-text.tsx
Executable file
@@ -0,0 +1,16 @@
|
||||
import {MessageDescriptor} from './message-descriptor';
|
||||
import {Trans} from './trans';
|
||||
import {Fragment} from 'react';
|
||||
|
||||
interface Props {
|
||||
value?: string | MessageDescriptor | null;
|
||||
}
|
||||
export function MixedText({value}: Props) {
|
||||
if (!value) {
|
||||
return null;
|
||||
}
|
||||
if (typeof value === 'string') {
|
||||
return <Fragment>{value}</Fragment>;
|
||||
}
|
||||
return <Trans {...value} />;
|
||||
}
|
||||
Reference in New Issue
Block a user