Feat: Agregar soporte para envío de Contacts, Polls y Events
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m8s

- Backend: Nuevo soporte en endpoint /send para tipos contact, poll, event
- UI: Modales para crear y enviar contactos, encuestas y eventos
- Visualización: Componentes MessagePoll y MessageEvent para mostrar mensajes recibidos
- Tipos: Agregar PollInfo, EventInfo y tipo 'event' a MessageType
This commit is contained in:
2025-12-04 12:06:35 -06:00
parent 48f23c512b
commit cb846d0c56
10 changed files with 1443 additions and 46 deletions

View File

@@ -15,6 +15,7 @@ export type MessageType =
| 'location'
| 'reaction'
| 'poll'
| 'event'
| 'unknown'
// Estados de mensaje
@@ -79,6 +80,50 @@ export interface ContactInfo {
phones?: string[]
}
/**
* Información de encuesta
*/
export interface PollInfo {
/** Nombre/pregunta de la encuesta */
name: string
/** Opciones de la encuesta */
options: string[]
/** Votos por opción */
votes?: number[]
/** Cantidad máxima de selecciones permitidas */
selectableCount?: number
}
/**
* Información de ubicación de evento
*/
export interface EventLocationInfo {
/** Nombre del lugar */
name?: string
/** Dirección */
address?: string
/** Latitud */
latitude?: number
/** Longitud */
longitude?: number
}
/**
* Información de evento
*/
export interface EventInfo {
/** Nombre del evento */
name: string
/** Fecha y hora de inicio */
startDate: string
/** Fecha y hora de fin */
endDate?: string
/** Descripción del evento */
description?: string
/** Ubicación del evento */
location?: EventLocationInfo
}
/**
* Información de mensaje citado (quoted/reply)
*/
@@ -139,6 +184,10 @@ export interface Message {
location?: LocationInfo
/** Información de contacto */
contact?: ContactInfo
/** Información de encuesta */
poll?: PollInfo
/** Información de evento */
event?: EventInfo
/** Mensaje citado */
quoted?: QuotedMessage
/** Reacciones al mensaje */
@@ -304,6 +353,7 @@ export function getMessageTypePlaceholder(type: MessageType): string {
location: 'Ubicación',
reaction: 'Reacción',
poll: 'Encuesta',
event: 'Evento',
unknown: 'Mensaje'
}
return placeholders[type] || 'Mensaje'
@@ -324,6 +374,7 @@ export function getMessageTypeIcon(type: MessageType): string {
location: 'i-lucide-map-pin',
reaction: 'i-lucide-heart',
poll: 'i-lucide-bar-chart',
event: 'i-lucide-calendar',
unknown: 'i-lucide-help-circle'
}
return icons[type] || 'i-lucide-message-square'