// @flow import * as React from 'react'; import { injectIntl } from 'react-intl'; import Button from '../../../components/button/Button'; import ButtonGroup from '../../../components/button-group/ButtonGroup'; import IconMinus from '../../../icons/general/IconMinusThin'; import IconPlus from '../../../icons/general/IconPlusThin'; import Field from './Field'; import messages from '../messages'; import './CustomField.scss'; type Props = { canEdit: boolean, dataKey: string, dataValue: MetadataFieldValue, intl: any, isLast: boolean, onAdd: () => void, onChange: (key: string, value: MetadataFieldValue) => void, onRemove: (key: string) => void, }; const COLOR_999 = '#999'; const CustomField = ({ intl, canEdit, isLast, dataKey, dataValue, onAdd, onChange, onRemove }: Props) => { const addBtn = ( ); const removeBtn = ( ); return (
{/* $FlowFixMe */} onChange(key, '')} type="string" /> {canEdit && (
{isLast ? ( {removeBtn} {addBtn} ) : ( removeBtn )}
)}
); }; export { CustomField as CustomFieldBase }; export default injectIntl(CustomField);