{!imagePreview ? (
diff --git a/frontend/src/context/ConfigContext.jsx b/frontend/src/context/ConfigContext.jsx
new file mode 100644
index 0000000..bd32e28
--- /dev/null
+++ b/frontend/src/context/ConfigContext.jsx
@@ -0,0 +1,44 @@
+import { createContext, useState, useEffect } from 'react';
+import { getConfig } from '../api/config';
+
+export const ConfigContext = createContext({
+ config: null,
+ loading: true,
+});
+
+export const ConfigProvider = ({ children }) => {
+ const [config, setConfig] = useState(null);
+ const [loading, setLoading] = useState(true);
+
+ useEffect(() => {
+ const fetchConfig = async () => {
+ try {
+ const data = await getConfig();
+ setConfig(data);
+ } catch (error) {
+ console.error('Failed to fetch config:', error);
+ // Set default fallback values
+ setConfig({
+ maxFileSizeMB: 20,
+ maxImageDimension: 800,
+ imageQuality: 85
+ });
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ fetchConfig();
+ }, []);
+
+ const value = {
+ config,
+ loading
+ };
+
+ return (
+
+ {children}
+
+ );
+};
diff --git a/frontend/src/styles/components/ImageUploadSection.css b/frontend/src/styles/components/ImageUploadSection.css
index 79c1378..fd30b43 100644
--- a/frontend/src/styles/components/ImageUploadSection.css
+++ b/frontend/src/styles/components/ImageUploadSection.css
@@ -10,6 +10,17 @@
color: #333;
}
+.image-upload-error {
+ background: #f8d7da;
+ border: 1px solid #f5c2c7;
+ color: #842029;
+ padding: 0.75rem;
+ border-radius: 6px;
+ margin-bottom: 0.8rem;
+ font-size: 0.9em;
+ line-height: 1.4;
+}
+
.image-upload-content {
border: 2px dashed #ccc;
border-radius: 8px;