-
- {wizard.errorMessage && (
-
- {wizard.errorMessage}
-
- )}
-
+
+
+ {wizard.errorMessage && (
+
+ {wizard.errorMessage}
+
+ )}
+
-
+
+
+
+ {!isLast ? (
-
- {!isLast ? (
-
- ) : (
-
- )}
-
+ ) : (
+
+ )}
)
diff --git a/src/components/wizard/StepWithTooltip.tsx b/src/components/wizard/StepWithTooltip.tsx
new file mode 100644
index 0000000..44f8e6e
--- /dev/null
+++ b/src/components/wizard/StepWithTooltip.tsx
@@ -0,0 +1,41 @@
+import { useState } from 'react'
+
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from '@/components/ui/tooltip'
+
+export function StepWithTooltip({
+ title,
+ desc,
+}: {
+ title: string
+ desc: string
+}) {
+ const [isOpen, setIsOpen] = useState(false)
+
+ return (
+
+
+
+ {
+ e.stopPropagation()
+ setIsOpen((prev) => !prev)
+ }}
+ onMouseEnter={() => setIsOpen(true)}
+ onMouseLeave={() => setIsOpen(false)}
+ >
+ {title}
+
+
+
+ {desc}
+
+
+
+ )
+}
diff --git a/src/components/wizard/WizardLayout.tsx b/src/components/wizard/WizardLayout.tsx
new file mode 100644
index 0000000..96fb1a5
--- /dev/null
+++ b/src/components/wizard/WizardLayout.tsx
@@ -0,0 +1,52 @@
+import * as Icons from 'lucide-react'
+
+import { CardHeader, CardTitle } from '@/components/ui/card'
+import { Dialog, DialogContent } from '@/components/ui/dialog'
+
+export function WizardLayout({
+ title,
+ onClose,
+ headerSlot,
+ footerSlot,
+ children,
+}: {
+ title: string
+ onClose: () => void
+ headerSlot?: React.ReactNode
+ footerSlot?: React.ReactNode
+ children: React.ReactNode
+}) {
+ return (
+
+ )
+}
diff --git a/src/components/wizard/WizardResponsiveHeader.tsx b/src/components/wizard/WizardResponsiveHeader.tsx
new file mode 100644
index 0000000..7766e13
--- /dev/null
+++ b/src/components/wizard/WizardResponsiveHeader.tsx
@@ -0,0 +1,59 @@
+import { CircularProgress } from '@/components/CircularProgress'
+import { StepWithTooltip } from '@/components/wizard/StepWithTooltip'
+
+export function WizardResponsiveHeader({
+ wizard,
+ methods,
+}: {
+ wizard: any
+ methods: any
+}) {
+ const idx = wizard.utils.getIndex(methods.current.id)
+ const totalSteps = wizard.steps.length
+ const currentIndex = idx + 1
+ const hasNextStep = idx < totalSteps - 1
+ const nextStep = wizard.steps[currentIndex]
+
+ return (
+ <>
+
+
+
+
+
+
+
+ {hasNextStep && nextStep ? (
+
+ Siguiente: {nextStep.title}
+
+ ) : (
+
+ ¡Último paso!
+
+ )}
+
+
+
+
+
+
+ {wizard.steps.map((step: any) => (
+
+
+
+
+
+ ))}
+
+
+ >
+ )
+}
diff --git a/src/features/asignaturas/nueva/NuevaAsignaturaModalContainer.tsx b/src/features/asignaturas/nueva/NuevaAsignaturaModalContainer.tsx
index e7b9fe0..23758c8 100644
--- a/src/features/asignaturas/nueva/NuevaAsignaturaModalContainer.tsx
+++ b/src/features/asignaturas/nueva/NuevaAsignaturaModalContainer.tsx
@@ -1,4 +1,5 @@
import { useNavigate } from '@tanstack/react-router'
+import * as Icons from 'lucide-react'
import { useNuevaAsignaturaWizard } from './hooks/useNuevaAsignaturaWizard'
@@ -6,13 +7,20 @@ import { PasoBasicosForm } from '@/components/asignaturas/wizard/PasoBasicosForm
import { PasoConfiguracionPanel } from '@/components/asignaturas/wizard/PasoConfiguracionPanel'
import { PasoMetodoCardGroup } from '@/components/asignaturas/wizard/PasoMetodoCardGroup'
import { PasoResumenCard } from '@/components/asignaturas/wizard/PasoResumenCard'
-import { VistaSinPermisos } from '@/components/asignaturas/wizard/VistaSinPermisos'
import { WizardControls } from '@/components/asignaturas/wizard/WizardControls'
-import { WizardHeader } from '@/components/asignaturas/wizard/WizardHeader'
import { defineStepper } from '@/components/stepper'
-import { Dialog, DialogContent } from '@/components/ui/dialog'
+import { Button } from '@/components/ui/button'
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+} from '@/components/ui/card'
+import { WizardLayout } from '@/components/wizard/WizardLayout'
+import { WizardResponsiveHeader } from '@/components/wizard/WizardResponsiveHeader'
-const auth_get_current_user_role = () => 'JEFE_CARRERA' as const
+const auth_get_current_user_role = (): string => 'JEFE_CARRERA'
const Wizard = defineStepper(
{
@@ -55,85 +63,90 @@ export function NuevaAsignaturaModalContainer({ planId }: { planId: string }) {
navigate({ to: `/planes/${planId}/asignaturas`, resetScroll: false })
}
+ if (role !== 'JEFE_CARRERA') {
+ return (
+
+
+
+
+
+ Sin permisos
+
+
+ Solo el Jefe de Carrera puede crear asignaturas.
+
+
+
+
+
+
+
+ )
+ }
+
return (
-