import { useState, useEffect } from 'react'; import { Save, CheckSquare, Settings } from 'lucide-react'; import { settingsApi, WalkthroughSettings, PhotoRequirement } from '../lib/settingsApi'; const PHOTO_OPTIONS: { label: string; value: PhotoRequirement }[] = [ { label: 'Always Required', value: 'REQUIRED' }, { label: 'Optional', value: 'OPTIONAL' }, { label: 'Weekly Only', value: 'WEEKLY' }, { label: 'On Demand', value: 'ON_DEMAND' }, ]; export default function WalkthroughSettingsPage() { const [settings, setSettings] = useState(null); const [isLoading, setIsLoading] = useState(false); useEffect(() => { loadSettings(); }, []); const loadSettings = async () => { try { const data = await settingsApi.getWalkthrough(); setSettings(data); } catch (e) { console.error(e); } }; const handleUpdate = async (e: React.FormEvent) => { e.preventDefault(); if (!settings) return; setIsLoading(true); try { await settingsApi.updateWalkthrough(settings); alert('Settings saved!'); } catch (e) { console.error(e); alert('Failed to save settings.'); } finally { setIsLoading(false); } }; if (!settings) return
Loading...
; return (

Walkthrough Settings

Configure daily checklist requirements and photo rules.

{/* Enabled Sections */}

Enabled Modules

{/* Photo Requirements */}

Photo Rules

); }