Update Settings.tsx

This commit is contained in:
2025-12-11 23:47:01 +01:00
committed by GitHub
parent eb31cd3f17
commit fcc1b8d909

View File

@@ -491,7 +491,7 @@ export const SettingsPage: React.FC = () => {
const updated = { ...notice, active: !notice.active }; const updated = { ...notice, active: !notice.active };
await CondoService.saveNotice(updated); await CondoService.saveNotice(updated);
setNotices(notices.map(n => n.id === notice.id ? updated : n)); setNotices(notices.map(n => n.id === notice.id ? updated : n));
} catch(e) { } catch (e) {
console.error(e); console.error(e);
} }
}; };
@@ -698,12 +698,14 @@ export const SettingsPage: React.FC = () => {
)} )}
{/* STORAGE CONFIG TAB */} {/* STORAGE CONFIG TAB */}
{isPrivileged && activeTab === 'storage' && globalSettings?.storageConfig && ( {isPrivileged && activeTab === 'storage' && (
<div className="animate-fade-in bg-white rounded-xl shadow-sm border border-slate-200 p-6 max-w-2xl"> <div className="animate-fade-in bg-white rounded-xl shadow-sm border border-slate-200 p-6 max-w-2xl">
<h3 className="text-lg font-bold text-slate-800 mb-4 flex items-center gap-2"><Cloud className="w-5 h-5 text-blue-600" /> Configurazione Storage</h3> <h3 className="text-lg font-bold text-slate-800 mb-4 flex items-center gap-2"><Cloud className="w-5 h-5 text-blue-600" /> Configurazione Storage</h3>
<p className="text-sm text-slate-500 mb-6">Scegli dove salvare i documenti caricati.</p> <p className="text-sm text-slate-500 mb-6">Scegli dove salvare i documenti caricati.</p>
<form onSubmit={handleStorageSubmit} className="space-y-6"> <form onSubmit={handleStorageSubmit} className="space-y-6">
{globalSettings?.storageConfig ? (
<>
<div> <div>
<label className="text-sm font-bold text-slate-700 mb-2 block">Provider Attivo</label> <label className="text-sm font-bold text-slate-700 mb-2 block">Provider Attivo</label>
<select <select
@@ -754,6 +756,10 @@ export const SettingsPage: React.FC = () => {
<Save className="w-4 h-4" /> Salva Impostazioni <Save className="w-4 h-4" /> Salva Impostazioni
</button> </button>
</div> </div>
</>
) : (
<div className="text-center p-4 text-slate-500">Inizializzazione configurazione storage...</div>
)}
</form> </form>
</div> </div>
)} )}