diff --git a/src/pages/DrillingProgram/CategoryRender.jsx b/src/pages/DrillingProgram/CategoryRender.jsx index d997135..7d93029 100644 --- a/src/pages/DrillingProgram/CategoryRender.jsx +++ b/src/pages/DrillingProgram/CategoryRender.jsx @@ -74,6 +74,16 @@ export const CategoryRender = memo(({ idWell, partData, onUpdate, onEdit, onHist `Удаление категории "${title}" скважины "${idWell}"` ), [idWell, idFileCategory, onUpdate, title]) + const onUploadComplete = useCallback(() => { + onUpdate?.(idFileCategory) + setIsUploading(false) + }, [onUpdate, idFileCategory]) + + const onUploadError = useCallback((e) => { + notify(e?.message ?? 'Ошибка загрузки файла', 'error') + setIsUploading(false) + }) + return (
@@ -111,8 +121,8 @@ export const CategoryRender = memo(({ idWell, partData, onUpdate, onEdit, onHist url={uploadUrl} style={{ margin: '5px 0 10px 0' }} onUploadStart={() => setIsUploading(true)} - onUploadComplete={() => onUpdate?.(idFileCategory)} - onUploadError={(e) => notify(e?.message ?? 'Ошибка загрузки файла', 'error')} + onUploadComplete={onUploadComplete} + onUploadError={onUploadError} /> )} +
Размер: {program?.size}
Загружен: {formatDate(program?.uploadDate)}