diff --git a/src/app/page.tsx b/src/app/page.tsx index d49c567..44e2ef9 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -5,6 +5,7 @@ import BuscarFuncionario from '@/components/BuscarFuncionario'; import OrganigramaInteractivo from '@/components/OrganigramaInteractivo'; import axios from 'axios'; import { Funcionario, PayloadBusqueda } from '@/types/Funcionarios'; +import { useRouter } from 'next/navigation'; export default function Home() { @@ -18,6 +19,8 @@ export default function Home() { const isPanning = useRef(false); const lastMouse = useRef<{ x: number; y: number } | null>(null); + const router = useRouter(); + const clamp = (v: number, a = 0.5, b = 5) => Math.min(Math.max(v, a), b); const handleWheel = useCallback((e: React.WheelEvent) => { @@ -105,6 +108,12 @@ export default function Home() { .join(' '); }; + const redirect = () => { + setResultados([]); + setCurrentAreaLabel(''); + router.push('/') + } + return (
@@ -112,7 +121,15 @@ export default function Home() {

Directorio de Funcionarios

- {currentAreaLabel &&

{currentAreaLabel}

} + {currentAreaLabel && ( +
+

+ {currentAreaLabel} +

+ + +
+ )} diff --git a/src/components/BuscarFuncionario.tsx b/src/components/BuscarFuncionario.tsx index 9e6698f..be0e5f7 100644 --- a/src/components/BuscarFuncionario.tsx +++ b/src/components/BuscarFuncionario.tsx @@ -1,4 +1,4 @@ - 'use client'; +'use client'; import React, { useState, useEffect } from 'react'; import axios from 'axios';