chore(env): update application version to 2.2.7 in production environment

feat(image-upload): introduce ImageUploadField component for enhanced image uploads

- Added ImageUploadField component to streamline image uploads with improved UI and functionality.
- Integrated file upload handling with a new file service for better management of image uploads.
- Updated SectionStep component to utilize ImageUploadField for icon uploads, enhancing user experience.
- Refactored TenderListFilters to use isDateRangeActive utility for improved date range filtering logic.
This commit is contained in:
AmirReza Jamali
2026-06-06 09:51:32 +03:30
parent a99f86b2f9
commit 5d01d66ea3
11 changed files with 436 additions and 56 deletions
+86
View File
@@ -0,0 +1,86 @@
"use client";
import FileImageUploadCard from "@/components/ui/FileImageUploadCard";
import { useImageUploadFieldPresenter } from "@/components/ui/useImageUploadFieldPresenter";
interface IProps {
value?: string;
onChange: (url: string) => void;
label: string;
inputId: string;
accept?: string;
title?: string;
hint?: string;
recommendation?: string;
fallbackFileName?: string;
category?: string;
tags?: string[];
description?: string;
allowedTypes?: string[];
maxSize?: number;
errorMessage?: string;
}
/**
* Controlled image upload field: renders the shared `FileImageUploadCard` and
* owns the upload lifecycle via `useImageUploadFieldPresenter`. Stores the
* resulting file URL through `onChange`.
*/
const ImageUploadField = ({
value,
onChange,
label,
inputId,
accept,
title,
hint,
recommendation,
fallbackFileName,
category,
tags,
description,
allowedTypes,
maxSize,
errorMessage,
}: IProps) => {
const {
fileRegister,
isUploading,
uploadProgress,
selectedFileName,
selectedFileSize,
previewUrl,
errorMessage: uploadError,
clear,
} = useImageUploadFieldPresenter({
value,
onChange,
category,
tags,
description,
allowedTypes,
maxSize,
});
return (
<FileImageUploadCard
label={label}
inputId={inputId}
accept={accept}
title={title}
hint={hint}
recommendation={recommendation}
fallbackFileName={fallbackFileName}
previewUrl={previewUrl}
selectedFileName={selectedFileName}
selectedFileSize={selectedFileSize}
isLoading={isUploading}
uploadProgress={uploadProgress}
errorMessage={uploadError ?? errorMessage}
onClear={clear}
fileRegister={fileRegister}
/>
);
};
export default ImageUploadField;