import { FormikErrors } from 'formik'; import { useStateWrapper } from '@/react/hooks/useStateWrapper'; import { FormError } from '@@/form-components/FormError'; import { InputGroup } from '@@/form-components/InputGroup'; import { InputList, ItemProps } from '@@/form-components/InputList'; interface Props { value: Array; onChange: (value: Array) => void; errors?: FormikErrors[] | string | string[]; } export function AdditionalFileField({ onChange, value, errors }: Props) { return ( ''} data-cy="gitops-additional-files" /> ); } function Item({ item, onChange, disabled, error, readOnly, index, }: ItemProps) { const [inputValue, updateInputValue] = useStateWrapper(item, onChange); return (
path { updateInputValue(e.target.value); }} data-cy={`gitops-additional-files_${index}`} /> {error && (
{error}
)}
); }