diff --git a/pages/Settings.tsx b/pages/Settings.tsx index 1327bb5..b17f414 100644 --- a/pages/Settings.tsx +++ b/pages/Settings.tsx @@ -6,7 +6,7 @@ import { Save, Building, Coins, Plus, Pencil, Trash2, X, CalendarCheck, AlertTriangle, User as UserIcon, Server, Bell, Clock, FileText, Lock, Megaphone, CheckCircle2, Info, Hammer, Link as LinkIcon, - Eye, Calendar, List, UserCog, Mail, Power, MapPin, CreditCard, + Eye, EyeOff, Calendar, List, UserCog, Mail, Power, MapPin, CreditCard, ToggleLeft, ToggleRight, LayoutGrid, PieChart, Users, Send, Cloud, HardDrive, ChevronRight, Palette, Image as ImageIcon, Upload } from 'lucide-react'; @@ -51,6 +51,7 @@ export const SettingsPage: React.FC = () => { const [condoForm, setCondoForm] = useState>({ name: '', address: '', streetNumber: '', city: '', province: '', zipCode: '', notes: '', paypalClientId: '', defaultMonthlyQuota: 100, dueDay: 10 }); + const [showPayPalKey, setShowPayPalKey] = useState(false); // State for PayPal input visibility const [saving, setSaving] = useState(false); const [successMsg, setSuccessMsg] = useState(''); @@ -342,7 +343,26 @@ export const SettingsPage: React.FC = () => {
setActiveCondo({...activeCondo, dueDay: parseInt(e.target.value)})} className="w-full border border-slate-200 p-3 rounded-xl" />
-
setActiveCondo({...activeCondo, paypalClientId: e.target.value})} className="w-full border border-slate-200 p-3 rounded-xl text-xs font-mono" />
+
+ +
+ setActiveCondo({...activeCondo, paypalClientId: e.target.value})} + className="w-full border border-slate-200 p-3 rounded-xl text-xs font-mono pr-10" + placeholder="sandbox_..." + /> + +
+

Necessario per abilitare i pagamenti online.

+
{successMsg && {successMsg}}
- {users.map(u => ( -
-

{u.name}

{u.email}

{u.role}
-
-
- ))} + {users.map(u => { + const isTargetAdmin = u.role === 'admin'; + // Logic: PowerUsers cannot edit/delete Admins + const canManage = !(currentUser?.role === 'poweruser' && isTargetAdmin); + + return ( +
+

{u.name}

{u.email}

{u.role}
+
+ {canManage ? ( + <> + + + + ) : ( + Protetto + )} +
+
+ ); + })}
)}