feat: Implement event and questionnaire management features

- Added event creation page with form handling and validation.
- Introduced layout for event management with context provider.
- Created event listing page with active and recent events display.
- Developed questionnaire creation page linked to events.
- Implemented breadcrumb navigation for better user experience.
- Added reusable components for event and questionnaire cards.
- Integrated API calls for fetching and managing event data.
- Enhanced slugify utility for better URL handling.
- Established context for managing event state across components.
This commit is contained in:
miguel
2025-08-12 20:00:21 -06:00
parent 5b0f0ad6bf
commit be8f207ecd
35 changed files with 2091 additions and 642 deletions
+16 -3
View File
@@ -7,8 +7,11 @@ import {
import SimpleInput from '@/components/input';
import Select from '@/components/select';
import Button from '@/components/button';
import { GetEventoWithCuestionariosWithCupos } from '@/types/evento';
import { formatearRangoFechas } from '@/utils/date-utils';
interface Props {
evento?: GetEventoWithCuestionariosWithCupos;
formulario: FormularioCreacion;
onChange: (formularioActualizado: FormularioCreacion) => void;
}
@@ -49,7 +52,11 @@ const tiposCuestionario = [
{ label: 'Evaluación', value: 2 },
];
export default function FormularioEditor({ formulario, onChange }: Props) {
export default function FormularioEditor({
formulario,
onChange,
evento,
}: Props) {
function actualizarCampo<K extends keyof FormularioCreacion>(
campo: K,
valor: FormularioCreacion[K]
@@ -173,7 +180,7 @@ export default function FormularioEditor({ formulario, onChange }: Props) {
<div className="col-md-6">
<SimpleInput
label="Fecha de Inicio"
type="date"
type="datetime-local"
value={formulario.fecha_inicio.slice(0, 16)}
onChange={(e) => actualizarCampo('fecha_inicio', e.target.value)}
/>
@@ -181,12 +188,18 @@ export default function FormularioEditor({ formulario, onChange }: Props) {
<div className="col-md-6">
<SimpleInput
label="Fecha de Fin"
type="date"
type="datetime-local"
value={formulario.fecha_fin.slice(0, 16)}
onChange={(e) => actualizarCampo('fecha_fin', e.target.value)}
/>
</div>
</div>
{evento && (
<div className="badge bg-primary fs-6 w-100 mb-3">
Este evento se realizara{' '}
{formatearRangoFechas(evento.fecha_inicio, evento.fecha_fin)}
</div>
)}
<Select
label="Tipo de Cuestionario"