import React, { useEffect, useRef, useState } from 'react' import { DndContext, closestCenter, PointerSensor, useSensor, useSensors } from '@dnd-kit/core' import { arrayMove, SortableContext, verticalListSortingStrategy, useSortable } from '@dnd-kit/sortable' import { CSS } from '@dnd-kit/utilities' import type { ChangeEvent } from 'react' import { Link } from 'react-router-dom' import type { SiteContent, CustomLink, CustomBlock, ColossiansStudySection, StudyProgram, RedirectRule, PodcastFeaturedLink, SeoSettings, LegalSettings } from './content' import { DEFAULTS } from './content' import { AnalyticsPanel } from './components/AnalyticsPanel' import { AdminCollapsibleCard } from './components/AdminCollapsibleCard' import { useAutosave } from './hooks/useAutosave' import QRCode from 'qrcode' interface SortableLessonRowProps { section: ColossiansStudySection study: StudyProgram onEdit: () => void removeStudySection: (studyId: string, sectionId: string) => void } function SortableLessonRow({ section, study, onEdit, removeStudySection }: SortableLessonRowProps) { const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({ id: section.id }) const style = { transform: CSS.Transform.toString(transform), transition, opacity: isDragging ? 0.4 : 1 } const isLive = section.releasedAt ? new Date(section.releasedAt) <= new Date() : false return (
Loading study users…
return (Manage student accounts — reset passwords, update display names, adjust enrollments, or delete accounts.
{users.length === 0 ? 'No study users yet.' : 'No users match your search.'}
}This immediately signs them out of all active sessions.
Not enrolled in any studies.
: (Sends the selected tier email immediately, regardless of inactivity threshold.
{msg[user.id]}
} {/* Delete */}Auto-inserted: {autoVars}
)} {fieldKeys.map(key => { const field = FIELDS.find(f => f.key === key && f.section === 'email-templates') if (!field) return null return (Every automated email the site sends — edit subject lines, body copy, and sign-offs. Publish to apply changes.
✓ Changes saved.
} {status === 'error' &&✗ {errorMsg}
} > ) } return (