@fakel/rest-admin
Version:
An application that makes it easier to work with your API
35 lines (31 loc) • 918 B
TypeScript
import React from 'react';
/**
* @example TranslatableCodeInputProps
*
* interface TranslatableCodeInputProps {
label?: string;
placeholde?: string;
}
const locales = { ru: 'Русский', uk: 'Украинский', en: 'Английский' };
const TranslatableCodeInput: React.FC<TranslatableCodeInputProps & AntFieldProps> = (props) => {
return (
<TranslatableInput locales={locales}>
{(locale) => {
return <CodeInput name={`${props.name}.${locale}`} label={props.label} />;
}}
</TranslatableInput>
);
};
export default TranslatableCodeInput;
*
*
*/
declare type Locale = {
[key: string]: string;
};
interface TranslatableInputProps {
locales: Locale;
children?: (activeLocale: string) => any;
}
declare const TranslatableInput: React.FC<TranslatableInputProps>;
export default TranslatableInput;