// DEPLOY_CONFIG: {"triggers": [{"name": "practice_email_reminder", "on": "collection.add", "collection": "practices", "actions": [{"type": "email", "to": "{{practice_email}}", "subject": "Upcoming Practice Reminder", "body": "Hi {{name}}, this is a reminder that your scheduled practice is coming up soon. Please be prepared and arrive on time."}]}, {"name": "session_all_members_confirmed", "on": "collection.update", "collection": "proposed_sessions", "actions": [{"type": "event", "config": {"event_type": "proposed_session_all_members_confirmed"}}]}]} import { useEffect, useRef, useState } from 'react'; import { useAuth, usePresence, renderMap, useCollection } from '@deplixo/sdk'; import { AvailabilityGrid } from './components/AvailabilityGrid.jsx'; import { OverlapFinder } from './components/OverlapFinder.jsx'; import { PracticeSessions } from './components/PracticeSessions.jsx'; function OnlineUsers() { const { users } = usePresence({ status: 'online' }); return (
{users.length} online
{users.map(u => ( {u.name} ))}
); } function PracticeLocationMap({ location, label = 'Practice Location' }) { const containerRef = useRef(null); useEffect(() => { if (!containerRef.current) return; const marker = location?.lat != null && location?.lng != null ? [{ lat: location.lat, lng: location.lng, popup: `${label}

${location.name || 'Practice location'}

${location.address ? `

${location.address}

` : ''}`, }] : []; renderMap(containerRef.current, { center: location?.lat != null && location?.lng != null ? [location.lat, location.lng] : [40.7128, -74.006], zoom: location?.lat != null && location?.lng != null ? 13 : 2, markers: marker, }); }, [location, label]); return
; } function App() { const { user, loading, login, logout } = useAuth(); const [activeTab, setActiveTab] = useState('availability'); const [practiceLocation, setPracticeLocation] = useState(''); const [practiceLocationName, setPracticeLocationName] = useState(''); const [practiceLocationCoords, setPracticeLocationCoords] = useState({ lat: '', lng: '' }); const tabs = [ { id: 'availability', label: '🗓️ My Availability', icon: '🗓️' }, { id: 'overlaps', label: '🔍 Find Times', icon: '🔍' }, { id: 'sessions', label: '🎸 Sessions', icon: '🎸' }, ]; if (loading) return
🎵

Signing you in...

Connecting BandSync to your Google account.

; if (!user) { return (
🎵

BandSync

Schedule practice, find time, rock on.

🔐

Sign in to continue

Use Google OAuth to join your band space, manage your availability, and create sessions as your authenticated identity.

); } return (
🎵

BandSync

Schedule practice, find time, rock on.

{user.avatar ? {user.name} : {(user.name || 'U').slice(0, 1).toUpperCase()}}
{user.name}
{user.email}

Practice Location

Shared with your band
setPracticeLocationName(e.target.value)} placeholder="Studio, garage, rehearsal space" />
setPracticeLocation(e.target.value)} placeholder="123 Main St, City, State" />
setPracticeLocationCoords(prev => ({ ...prev, lat: e.target.value }))} placeholder="40.7128" />
setPracticeLocationCoords(prev => ({ ...prev, lng: e.target.value }))} placeholder="-74.0060" />
{practiceLocationName || 'Practice location'} {practiceLocation || 'No address set yet'}
{activeTab === 'availability' && } {activeTab === 'overlaps' && } {activeTab === 'sessions' && }
); } ReactDOM.createRoot(document.getElementById("root")).render();