UNPKG

analytica-frontend-lib

Version:

Repositório público dos componentes utilizados nas plataformas da Analytica Ensino

1 lines 3.23 kB
{"version":3,"sources":["../../src/components/SendActivityModal/types.ts"],"sourcesContent":["import type { CategoryConfig } from '../CheckBoxGroup/CheckBoxGroup';\n\n// Re-export types from CheckboxGroup for easier imports\nexport type { CategoryConfig, Item } from '../CheckBoxGroup/CheckBoxGroup';\n\n/**\n * Activity subtype matching backend SIMULATION_SUBTYPE\n */\nexport type ActivitySubtype = 'TAREFA' | 'TRABALHO' | 'PROVA';\n\n/**\n * Activity type options for UI selection\n */\nexport const ACTIVITY_TYPE_OPTIONS: ReadonlyArray<{\n value: ActivitySubtype;\n label: string;\n}> = [\n { value: 'TAREFA', label: 'Tarefa' },\n { value: 'TRABALHO', label: 'Trabalho' },\n { value: 'PROVA', label: 'Prova' },\n] as const;\n\n/**\n * Form data structure for sending activity\n */\nexport interface SendActivityFormData {\n /** Activity subtype (Step 1) */\n subtype: ActivitySubtype;\n /** Activity title (Step 1) */\n title: string;\n /** Notification message (Step 1) */\n notification?: string;\n /** Array of students to send activity to (Step 2) */\n students: Array<{\n studentId: string;\n userInstitutionId: string;\n }>;\n /** Start date in YYYY-MM-DD format (Step 3) */\n startDate: string;\n /** Start time in HH:MM format (Step 3) */\n startTime: string;\n /** End date in YYYY-MM-DD format (Step 3) */\n finalDate: string;\n /** End time in HH:MM format (Step 3) */\n finalTime: string;\n /** Allow retry flag (Step 3) */\n canRetry: boolean;\n}\n\n/**\n * Initial data for pre-filling the modal form\n */\nexport interface SendActivityModalInitialData {\n /** Pre-filled activity title */\n title?: string;\n /** Pre-filled activity subtype */\n subtype?: ActivitySubtype;\n /** Pre-filled notification message */\n notification?: string;\n}\n\n/**\n * Modal props\n */\nexport interface SendActivityModalProps {\n /** Controls modal visibility */\n isOpen: boolean;\n /** Callback when modal is closed */\n onClose: () => void;\n /** Callback when activity is submitted */\n onSubmit: (data: SendActivityFormData) => Promise<void>;\n /** Recipient categories configuration (same format as CheckboxGroup) */\n categories: CategoryConfig[];\n /** Callback when categories change (optional - for controlled state) */\n onCategoriesChange?: (categories: CategoryConfig[]) => void;\n /** Loading state for submit button */\n isLoading?: boolean;\n /** Callback when submission fails (optional - if not provided, error propagates) */\n onError?: (error: unknown) => void;\n /** Initial data to pre-fill the form */\n initialData?: SendActivityModalInitialData;\n}\n\n/**\n * Step validation errors\n */\nexport interface StepErrors {\n subtype?: string;\n title?: string;\n students?: string;\n startDate?: string;\n startTime?: string;\n finalDate?: string;\n finalTime?: string;\n}\n\n/**\n * Step state for stepper\n */\nexport type StepState = 'pending' | 'current' | 'completed';\n\n/**\n * Step configuration\n */\nexport interface StepConfig {\n label: string;\n state: StepState;\n}\n"],"mappings":";AAaO,IAAM,wBAGR;AAAA,EACH,EAAE,OAAO,UAAU,OAAO,SAAS;AAAA,EACnC,EAAE,OAAO,YAAY,OAAO,WAAW;AAAA,EACvC,EAAE,OAAO,SAAS,OAAO,QAAQ;AACnC;","names":[]}