{duplicateWarning()} {duplicateWarning() === 1 ? "entry appears" : "entries appear"} to be duplicates of existing ones. They were still imported — you can review and delete them in your vault.
);
}
function SubviewHeader(props: {
title: string;
onBack: () => void;
mode: "existing" | "onboarding";
}) {
// Onboarding sub-flows reuse the lock-screen header; existing-vault flows
// use the standard overlay back-arrow header.
return (
}
>
);
}
function getImportErrorCopy(error: string): string {
switch (error) {
case "UNSUPPORTED_IMPORT_FORMAT":
return "Unrecognised file format. Use CSV, Bitwarden JSON, Proton Pass JSON/CSV, or a Peach encrypted backup.";
case "INVALID_EXPORT_PASSWORD":
case "INVALID_PASSPHRASE":
return "Wrong backup password. This is the password you chose when you created the backup.";
case "INVALID_PEACH_EXPORT":
return "This Peach backup file looks corrupted or incomplete.";
case "INVALID_PEACHSCRIPT_CHARACTER":
return "This doesn't look like PeachScript. Make sure you copied the entire backup string.";
case "PAYLOAD_TOO_SHORT":
return "PeachScript looks truncated. Copy the full backup string and try again.";
case "BAD_MAGIC":
case "UNSUPPORTED_VERSION":
return "This PeachScript was created by a different version of Peach.";
case "CHECKSUM_FAILED":
return "PeachScript appears corrupted. Re-copy from the source device.";
case "CREATE_VAULT_FAILED":
return "Peach couldn't create a new local vault before importing.";
case "CLEAR_VAULT_FAILED":
return "Peach couldn't clear the existing vault before replacing it.";
case "MASTER_PASSWORD_REQUIRED":
return "Choose a master password for your new vault first.";
case "RESTORE_FAILED":
return "Restore failed. Your existing vault is unchanged.";
case "NO_ENTRIES_IMPORTED":
return "No importable password entries were found in that file.";
default:
return error;
}
}