@sparklink-pro/apant
Version:
Apollo & Antd tools
12 lines • 687 B
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Input } from 'antd';
const locales = ['fr', 'en'];
export function Translations({ value, onChange }) {
const handleChange = (locale, e) => {
const newValue = Object.assign(Object.assign({}, value), { [locale]: e.target.value });
onChange(newValue);
};
return (_jsx("div", { children: locales.map((locale) => (_jsxs("div", { className: "flex items-center", children: [_jsx("span", { children: locale }), _jsx(Input, { value: value ? value[locale] : '', onChange: (e) => handleChange(locale, e) })] }, locale))) }));
}
export default Translations;
//# sourceMappingURL=Translations.js.map