e.stopPropagation()}
style={{ maxWidth: 660, width: "92%", padding: "24px 24px 20px", maxHeight: "90vh", display: "flex", flexDirection: "column" }}
>
{/* Header */}
⚙️ {t("settingsModalTitle") || "Settings"}
{/* Tab Bar */}
{tabs.map((tab) => (
))}
{/* Scrollable tab content */}
{/* Tab 1: Profile */}
{activeTab === "profile" && (
)}
{/* Tab 2: Preferences */}
{activeTab === "preferences" && (
{t("trashRetentionHint") || "Deleted tasks will be permanently removed after the specified period."}
{[
{ key: "system", icon: "💻", label: t("themeSystem") },
{ key: "light", icon: "☀️", label: t("themeLight") },
{ key: "dark", icon: "🌙", label: t("themeDark") },
].map(({ key, icon, label }) => (
))}
)}
{/* Tab 3: 🧪 CheckFlow Labs */}
{activeTab === "labs" && (
{/* Section: View */}
View
updatePrefs({ viewMode: v })}
/>
{/* Section: Layout */}
Layout
updatePrefs({ density: v })}
/>
updatePrefs({ sidebarWidth: v })}
unit="px"
/>
updatePrefs({ detailWidth: v })}
unit="px"
/>
{/* Section: Appearance */}
Appearance
updatePrefs({ fontSize: v })}
/>
{/* Hue ring preview */}
{[210, 250, 340, 10, 45, 145, 185].map((h) => (
updatePrefs({ accentHue: h })}
title={`Hue ${h}°`}
style={{
width: 20,
height: 20,
borderRadius: "50%",
background: `hsl(${h}, ${sat}%, 54%)`,
cursor: "pointer",
border: prefs.accentHue === h ? "2.5px solid var(--text-primary)" : "2px solid transparent",
outline: prefs.accentHue === h ? `3px solid ${accentPreview}` : "none",
outlineOffset: 1,
transition: "transform var(--dur-fast)",
transform: prefs.accentHue === h ? "scale(1.2)" : "scale(1)",
}}
/>
))}
Saturation
updatePrefs({ saturation: v })}
unit="%"
/>
{/* Custom hue input */}
updatePrefs({ roundness: v })}
/>
updatePrefs({ animationSpeed: v })}
/>
{/* Reset to Defaults */}
)}
{/* Tab: CalDAV / External Sync */}
{activeTab === "sync" && (
📱 {t("syncTitle") || "Galaxy & External Sync (CalDAV)"}
{t("syncDesc") || "CheckFlow supports native two-way synchronization with Samsung Galaxy Reminder, Apple Reminders, and Thunderbird via CalDAV."}
{/* Endpoint bar & Action buttons */}
{/* Actions row: Test & Download */}
📥 {t("syncDownloadIcs") || "Download .ICS Feed"}
{testSyncStatus === "success" && (
{t("syncTestSuccess") || "✓ CalDAV endpoint responded successfully"}
)}
{testSyncStatus === "error" && (
✕ Endpoint test failed
)}
{/* Client setup guides segmented selector */}
setSyncPlatform(v)}
/>
{/* Step by step cards */}
{syncPlatform === "android" && (
📱 Samsung Galaxy & Android (DAVx⁵ + Reminder / OpenTasks)
- {t("syncAndroidStep1")}
- {t("syncAndroidStep2")}
- {t("syncAndroidStep3")}
- {t("syncAndroidStep4")}
💡 Tip: In DAVx⁵ account settings, set Sync Interval to 15 minutes for battery efficiency and near real-time sync.
)}
{syncPlatform === "apple" && (
🍎 Apple Reminders & Calendar (iOS / iPadOS / macOS)
- {t("syncAppleStep1")}
- {t("syncAppleStep2")}
- {t("syncAppleStep3")}
- {t("syncAppleStep4")}
💡 Tip: If using HTTPS behind a reverse proxy (Nginx/Caddy), ensure valid SSL certificates are trusted by Apple devices.
)}
{syncPlatform === "thunderbird" && (
💻 Mozilla Thunderbird (Windows / Mac / Linux)
- {t("syncThunderbirdStep1")}
- {t("syncThunderbirdStep2")}
- {t("syncThunderbirdStep3")}
- {t("syncThunderbirdStep4")}
💡 Tip: Thunderbird Tasks view will display CheckFlow priority tags, due dates, and completion status.
)}
)}
{/* Tab 4: Admin Quick Access */}
{activeTab === "admin" && (
👑 Multi-User Admin Console
Manage registered users, user roles (User/Admin), system statistics, and storage allocations.
🚀 Open Admin Dashboard →
)}
{/* Footer */}
{savedMsg &&
{savedMsg}}