// Caja de herramientas con tipos de preguntas disponibles // Funcionalidades: // - Lista de elementos arrastrables // - Tipos disponibles: Título, Pregunta Simple, Opción Múltiple, Opción Única, Selección // - Cada elemento es arrastrable al área de construcción 'use client'; import { Card, CardContent } from '@repo/shadcn/card'; import { QuestionType } from '../../schemas/survey'; import { useDraggable } from '@dnd-kit/core'; import { CSS } from '@dnd-kit/utilities'; const questionTypes = [ { type: QuestionType.TITLE, label: 'Título', icon: '📝', }, { type: QuestionType.SIMPLE, label: 'Pregunta Simple', icon: '✏️', }, { type: QuestionType.MULTIPLE_CHOICE, label: 'Opción Múltiple', icon: '☑️', }, { type: QuestionType.SINGLE_CHOICE, label: 'Opción Única', icon: '⭕', }, { type: QuestionType.SELECT, label: 'Selección', icon: '📋', }, ]; function DraggableItem({ type, label, icon }: { type: string; label: string; icon: string }) { const { attributes, listeners, setNodeRef, transform } = useDraggable({ id: type, data: { type, isTemplate: true, }, }); const style = transform ? { transform: CSS.Translate.toString(transform), } : undefined; return (
{icon} {label}
); } export function QuestionToolbox() { return (

Elementos Disponibles

{questionTypes.map((item) => ( ))}
); }