1 import type { FormikErrors } from 'formik';
2 import { c } from 'ttag';
4 import { type ExportFormValues, ExportFormat } from '@proton/pass/lib/export/types';
5 import { isEmptyString } from '@proton/pass/utils/string/is-empty-string';
7 export const validateExportForm = (values: ExportFormValues): FormikErrors<ExportFormValues> =>
8 values.format === ExportFormat.PGP && isEmptyString(values.passphrase)
9 ? { passphrase: c('Warning').t`Passphrase is required` }