const mappedActionButtons = useMemo<MappedActionButton[]>(
		() =>
			actionButtons
				.filter((it) => it.code !== 'EXIT')
				.filter((it) => isEditableForm || it.code !== 'SAVE_SECTION')
				.map((actionButton) => {
					const baseProps: MappedActionButton = {
						...actionButton,
						loading: clarificationFormActionPending[actionButton.code],
						disabled:
							isClarificationFormPending ||
							isFormProtocolManualPending ||
							isGetDocumentPending ||
							(actionButton.blockOnChange && isDirty) ||
							(Boolean(actionButton.data?.BLOCK_ON_ERROR) && hasDocumentErrors),
						onClick: () => undefined,
					};

					switch (actionButton.code) {
						case 'DOWNLOAD_DOCUMENT': {
							return {
								...baseProps,
								onClick: async () =>
									callClarificationAction({
										actionCode: 'DOWNLOAD_DOCUMENT',
										action: () =>
											downloadClarificationDoc({
												docId,
												documentType,
											}),
									}),
							};
						}

						case 'CLONE': {
							if (isExternalDocumentType(documentType)) {
								return {
									...baseProps,
									onClick: () =>
										cloneExternalDoc({
											clonedDocId: docId,
											externalDocType: documentType,
											openClarificationForm,
											pprbDealId,
											pprbProductId,
										}),
								};
							}

							return baseProps;
						}

						case 'DOWNLOAD_CIRCUMSTANCES': {
							return {
								...baseProps,
								onClick: async () =>
									callClarificationAction({
										actionCode: 'DOWNLOAD_CIRCUMSTANCES',
										action: () => downloadCircumstances({ documentType, pprbProductId }),
									}),
							};
						}

						case 'DOWNLOAD_APPENDIX_DOCUMENTS': {
							return {
								...baseProps,
								onClick: async () =>
									callClarificationAction({
										actionCode: 'DOWNLOAD_APPENDIX_DOCUMENTS',
										action: () => downloadAppendixDocuments({ documentType, pprbProductId }),
									}),
							};
						}

						case 'DOWNLOAD_CIRCUMSTANCES_MODEL': {
							return {
								...baseProps,
								onClick: async () =>
									callClarificationAction({
										actionCode: 'DOWNLOAD_CIRCUMSTANCES_MODEL',
										action: () => downloadCircumstancesModel({ documentType, pprbProductId }),
									}),
							};
						}

						case 'DOWNLOAD_APPENDIX_DOCUMENTS_MODEL': {
							return {
								...baseProps,
								onClick: async () =>
									callClarificationAction({
										actionCode: 'DOWNLOAD_APPENDIX_DOCUMENTS_MODEL',
										action: () => downloadAppendixDocumentsModel({ documentType, pprbProductId }),
									}),
							};
						}

						case 'DOWNLOAD_MODEL': {
							return {
								...baseProps,
								onClick: async () =>
									callClarificationAction({
										actionCode: 'DOWNLOAD_MODEL',
										action: () =>
											downloadClarificationDocModel({
												docId,
												documentType,
											}),
									}),
							};
						}

						case 'SAVE_SECTION': {
							return {
								...baseProps,
								onClick: async () =>
									callClarificationAction({
										actionCode: 'SAVE_SECTION',
										action: () =>
											saveClarificationForm({ documentId: docId, documentType, sectionCode }),
									}),
							};
						}

						case 'PUBLISH_DOCUMENT_TO_ECM':
							return {
								...baseProps,
								onClick: async () =>
									callClarificationAction({
										actionCode: 'PUBLISH_DOCUMENT_TO_ECM',
										action: () => uploadDocumentToEkd({ documentId: docId, documentType }),
									}),
							};

						case 'PUBLISH_PROTOCOL_TO_ECM':
							return {
								...baseProps,
								onClick: async () =>
									callClarificationAction({
										actionCode: 'PUBLISH_PROTOCOL_TO_ECM',
										action: (() =>
											formProtocolManual({ documentId: docId })) as unknown as () => Promise<void>,
									}),
							};

						case 'SES_SEND_FOR_SIGNING': {
							const actionButtonSettings = actionButton.data as SendDocumentForSigningData;

							return {
								...baseProps,
								disabled:
									isClarificationFormPending ||
									(actionButton.blockOnChange && isDirty) ||
									!actionButtonSettings?.PRINTED,
								onClick: async () =>
									callClarificationAction({
										actionCode: 'SES_SEND_FOR_SIGNING',
										action: () => sendDocumentForSigning({ documentId: docId, documentType }),
									}),
							};
						}

						case 'RETURN': {
							return {
								...baseProps,
								onClick: async () =>
									callClarificationAction({
										actionCode: 'RETURN',
										action: () => returnDocumentForEditing({ documentId: docId, documentType }),
									}),
							};
						}

						case 'SES_CANCEL_SIGNING': {
							return {
								...baseProps,
								onClick: async () =>
									callClarificationAction({
										actionCode: 'SES_CANCEL_SIGNING',
										action: () => returnDocumentForEditing({ documentId: docId, documentType }),
									}),
							};
						}

						case 'SES_CLIENT_REFUSE': {
							return {
								...baseProps,
								onClick: async () =>
									callClarificationAction({
										actionCode: 'SES_CLIENT_REFUSE',
										action: () => cancelDocumentSigning({ documentId: docId, documentType }),
									}),
							};
						}

						case 'EDIT_DOCUMENT': {
							return {
								...baseProps,
								onClick: async () =>
									callClarificationAction({
										actionCode: 'EDIT_DOCUMENT',
										action: () => returnSbbolDocument({ documentId: docId, documentType }),
									}),
							};
						}

						case 'RETURN_DOCUMENT': {
							return {
								...baseProps,
								onClick: async () =>
									callClarificationAction({
										actionCode: 'RETURN_DOCUMENT',
										action: () => cancelSbbolSigning({ documentId: docId, documentType }),
									}),
							};
						}

						case 'SEND_DOCUMENT_TO_SBBOL': {
							return {
								...baseProps,
								onClick: async () =>
									callClarificationAction({
										actionCode: 'SEND_DOCUMENT_TO_SBBOL',
										action: () => sendSbbolDocumentForSigning({ documentId: docId, documentType }),
									}),
							};
						}

						default: {
							return baseProps;
						}
					}
				}),
		export const ACTION_BUTTONS_FIXTURE: ActionButton[] = [
	{
		code: 'SAVE_SECTION',
		name: 'Сохранить',
		icon: null,
		type: 'SECONDARY',
		blockOnChange: false,
		data: null,
	},
	{
		code: 'DOWNLOAD_MODEL',
		name: 'Модель',
		icon: 'DOWNLOAD',
		type: 'SECONDARY',
		blockOnChange: false,
		data: null,
	},
	{
		code: 'DOWNLOAD_DOCUMENT',
		name: 'Скачать',
		icon: 'DOWNLOAD',
		type: 'SECONDARY',
		blockOnChange: false,
		data: {
			BLOCK_ON_ERROR: true,
		},
	},
	{
		code: 'PUBLISH_DOCUMENT_TO_ECM',
		name: 'Разместить в ЭКД',
		icon: null,
		type: 'PRIMARY',
		blockOnChange: true,
		data: null,
	},
	{}, 
]; заполни аналогичным образом констатну ACTION_BUTTONS_FIXTURE