Add checkbox for telegram notifications

This commit is contained in:
blankhex committed 2026-10-25 10:01:20 +03:00
1 parent e65d1ac46b
commit d4257e7dab
10 files changed
+74 -15

No files matched your search

+12
View File
@@ -20,6 +20,9 @@ export default function PlanMeetingPage({ onCreated, onCancel }) {
// When checked the author is recorded as joining straight away. Checked by
// default, since planning a meeting usually means you intend to attend.
const [autoJoin, setAutoJoin] = useState(true)
// When checked the Telegram bot announces the meeting. Checked by default;
// users uncheck it to create a meeting silently.
const [hasNotification, setHasNotification] = useState(true)
const [saving, setSaving] = useState(false)
const [error, setError] = useState('')
@@ -42,6 +45,7 @@ export default function PlanMeetingPage({ onCreated, onCancel }) {
// instant the backend expects.
scheduledAt: new Date(scheduledAt).toISOString(),
autoJoin,
hasNotification,
})
onCreated?.()
} catch (err) {
@@ -102,6 +106,14 @@ export default function PlanMeetingPage({ onCreated, onCancel }) {
/>
I will join this meeting
</label>
<label className="checkbox">
<input
type="checkbox"
checked={hasNotification}
onChange={(e) => setHasNotification(e.target.checked)}
/>
Send a Telegram notification
</label>
<button className="btn-primary" type="submit" disabled={saving}>
{saving ? 'Creating…' : 'Create meeting'}
</button>