UNPKG

@sparklink-pro/apant

Version:

Apollo & Antd tools

14 lines 778 B
import { __rest } from "tslib"; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { Input } from 'antd'; const locales = ['fr', 'en']; export function Translations(_a) { var { value, onChange } = _a, rest = __rest(_a, ["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