/* @component-map * App — Main container, role switching, layout shell [app.jsx] * HostView — Host creates/manages polls [components/HostView.jsx] * RespondentView — Respondents vote on polls [components/RespondentView.jsx] * PollCreator — Form to create new polls [components/PollCreator.jsx] * PollResults — Real-time bar chart results [components/PollResults.jsx] * @end-component-map */ // DEPLOY_CONFIG: {"cron": [], "triggers": [{"name": "poll_auto_close_and_email_results", "on": "collection.add", "collection": "poll_responses", "actions": [{"type": "event", "event_type": "poll.check_threshold_and_export"}]}, {"name": "poll_email_host_results_on_threshold", "on": "event", "event_type": "poll.threshold_reached", "actions": [{"type": "email", "to": "{{poll.host_email}}", "subject": "Your poll has reached 100 responses", "body": "Your poll has reached the 100-response threshold and has been auto-closed. The results export is ready, including CSV data with timestamps for every response.\n\nCSV link: {{poll.csv_url}}\n\nCSV content:\n{{poll.csv_content}}\n\nPoll ID: {{poll.id}}\nResponses: {{poll.response_count}}"}]}]} import { useEffect, useMemo, useState } from 'react'; import { useIdentity, useCollection, usePresence } from '@deplixo/sdk'; import { HostView } from './components/HostView.jsx'; import { RespondentView } from './components/RespondentView.jsx'; function App() { const { user, loading } = useIdentity(); const [role, setRole] = useState(null); const respondentIdentity = useMemo(() => { if (!user) return null; return { id: user.id, name: user.name, role: 'respondent' }; }, [user]); if (loading) { return (
Loading polls…
Real-time polling with instant results
Welcome, {user.name}