diff --git a/app/(private)/ActivosMantenimiento/page.tsx b/app/(private)/ActivosMantenimiento/page.tsx index 2f0136d..66332ee 100644 --- a/app/(private)/ActivosMantenimiento/page.tsx +++ b/app/(private)/ActivosMantenimiento/page.tsx @@ -1,52 +1,32 @@ import Areas from "@/app/Components/ActivosMantenimiento/Areas"; -import Mesas from "@/app/Components/ActivosMantenimiento/Mesas"; -import Equipos from "@/app/Components/Equipos/equipos"; -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; -import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; +import MesasDisponibles from "@/app/Components/ActivosMantenimiento/MesasDisponibles"; +import TableEquipos from "@/app/Components/Equipos/tableequipos"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; export default async function Page(props: { searchParams?: Promise<{ + key?: string; numAcount?: string; machine?: string; - success?: string; - error?: string; }>; }) { const params = await props.searchParams; + const key = params?.key && params.key; const numAcount = params?.numAcount ? params.numAcount : null; - const showSuccess = params?.success ? params.success : null; - const showError = params?.error ? params.error : null; return (
- {showError && ( - <> - - - - )} - - {showSuccess && ( - <> - - - - )} -

EQUIPOS ACTIVOS Y EN MANTENIMIENTO

- - + ), }, @@ -61,10 +41,10 @@ export default async function Page(props: { }, { key: "Mesas", - label: "Liberar mesa", + label: "Mesas", content: ( <> - + ), }, diff --git a/app/(private)/AgregarTiempo/addTime.css b/app/(private)/AgregarTiempo/addTime.css index 8a95b1d..1fe80b1 100644 --- a/app/(private)/AgregarTiempo/addTime.css +++ b/app/(private)/AgregarTiempo/addTime.css @@ -1,11 +1,11 @@ .addTime { - position: relative; - max-width: 600px; - margin-top: 1rem; - border: 1px solid #e5e7eb; - border-radius: 4px; - background-color: #f9fafb; - padding: 1rem; - display: flex; - flex-direction: column; -} \ No newline at end of file + position: relative; + max-width: 600px; + margin-top: 1rem; + border-radius: 4px; + background-color: #fff; + padding: 1rem; + display: flex; + flex-direction: column; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); +} diff --git a/app/(private)/AgregarTiempo/page.tsx b/app/(private)/AgregarTiempo/page.tsx index 723498d..df7fc96 100644 --- a/app/(private)/AgregarTiempo/page.tsx +++ b/app/(private)/AgregarTiempo/page.tsx @@ -1,31 +1,27 @@ import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; import Information from "@/app/Components/Global/Information/information"; import Receipt from "@/app/Components/Receipt/Receipt"; -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; +import toast from "react-hot-toast"; import { GetStudent } from "@/app/lib/getStudent"; import "./addTime.css"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; export default async function Page(props: { searchParams?: Promise<{ numAcount: string; - success?: string; - error?: string; }>; }) { const params = await props.searchParams; const numAcount = params?.numAcount ? params.numAcount : null; - const showSuccess = params?.success ? params.success : null; - let showError = params?.error ? params.error : null; let student: any = null; if (numAcount) { const result = await GetStudent(parseInt(numAcount)); if (result.error) { - showError = "Alumno no encontrado"; + toast.error("Alumno no encontrado"); + return; } else { student = result; } @@ -33,34 +29,19 @@ export default async function Page(props: { return (
- {showError && ( - <> - - - - )} - - {showSuccess && ( - <> - - - - )} -

AGREGAR TIEMPO

- {student ? ( + {student && ( <>
+
- ) : ( - <> )}
); diff --git a/app/(private)/Alta/page.tsx b/app/(private)/Alta/page.tsx index 2e51c0a..6f534c4 100644 --- a/app/(private)/Alta/page.tsx +++ b/app/(private)/Alta/page.tsx @@ -1,34 +1,14 @@ -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; import RegisterAlta from "@/app/Components/Alta/registerAlta"; import "./style.css"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; export default async function Page(props: { searchParams?: Promise<{ - success?: string; - error?: string; }>; }) { const params = await props.searchParams; - const showSuccess = params?.success ? params.success : null; - const showError = params?.error ? params.error : null; - return (
- {showError && ( - <> - - - - )} - - {showSuccess && ( - <> - - - - )}

ALTA

diff --git a/app/(private)/Alta/style.css b/app/(private)/Alta/style.css index bf559d8..4bf3b2f 100644 --- a/app/(private)/Alta/style.css +++ b/app/(private)/Alta/style.css @@ -3,7 +3,8 @@ grid-template-columns: 1fr 1fr; } .containerAlta { - background-color: #f9f9f9; + background-color: #fff; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); width: 100%; max-width: 900px; padding: 1rem; diff --git a/app/(private)/AsignacionEquipo/page.tsx b/app/(private)/AsignacionEquipo/page.tsx index 88e8350..700a708 100644 --- a/app/(private)/AsignacionEquipo/page.tsx +++ b/app/(private)/AsignacionEquipo/page.tsx @@ -1,60 +1,46 @@ -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; import { GetStudent } from "@/app/lib/getStudent"; -import "@/app/globals.css"; -import SearchBoxEquipo from "@/app/Components/SearchEquipo"; -import CheckBox from "@/app/Components/CheckBox"; import CheckBoxEquipo from "@/app/Components/CheckBoxEquipo"; import Information from "@/app/Components/Global/Information/information"; +import ShowError from "@/app/Components/Global/ShowError"; + +import "@/app/globals.css"; export default async function Page(props: { searchParams?: Promise<{ + key?:string numAcount?: string; machine?: string; - success?: string; - error?: string; }>; }) { const params = await props.searchParams; + const key = params?.key && params.key; const numAcount = params?.numAcount ? params.numAcount : null; const machine = params?.machine ? params.machine : null; - const showSuccess = params?.success ? params.success : null; - const showError = params?.error ? params.error : null; let student: any = null; + let errorMessage = ""; if (numAcount) { const result = await GetStudent(parseInt(numAcount)); if (result.error) { + errorMessage = `${result.error}`; } else { - student = result; + student = result as Student; } } return (
- {showError && ( - <> - - - - )} - - {showSuccess && ( - <> - - - - )} + {errorMessage && }

ASIGNACION DE EQUIPOS

- - - - - - + {student && ( + <> + + + {/*
+ + + +
+ + +
+
*/} + + )} ), }, diff --git a/app/(private)/AsignacionMesas/page.tsx b/app/(private)/AsignacionMesas/page.tsx index 656ca73..984dc47 100644 --- a/app/(private)/AsignacionMesas/page.tsx +++ b/app/(private)/AsignacionMesas/page.tsx @@ -2,35 +2,74 @@ import AsignacionMesas from "@/app/Components/AsignacionMesas"; import CheckBox from "@/app/Components/CheckBox"; import Information from "@/app/Components/Global/Information/information"; import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; +import ShowError from "@/app/Components/Global/ShowError"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; +import { GetStudent } from "@/app/lib/getStudent"; + +export default async function Page(props: { + searchParams?: Promise<{ + key: string; + numAcount: string; + }>; +}) { + const params = await props.searchParams; + const key = params?.key && params.key; + const numAcount = params?.numAcount ? params.numAcount : null; + + let student: any = null; + let errorMessage = ""; + + if (numAcount) { + const result = await GetStudent(parseInt(numAcount)); + + if (result.error) { + errorMessage = `${result.error}`; + } else { + student = result as Student; + } + } -export default function Page() { return (
+ {errorMessage && }

ASIGNACION DE MESAS

- - - - - - + + {student && ( + <> + + {/*
+ +
+ + +
+
*/} + + + )} ), }, { - key: "Liberar", - label: "Liberar mesa", + key: "Tiempo", + label: "Cancelar Tiempo", content: ( <> diff --git a/app/(private)/BitacoraSanciones/page.tsx b/app/(private)/BitacoraSanciones/page.tsx index cc6c2cd..5ebe1ff 100644 --- a/app/(private)/BitacoraSanciones/page.tsx +++ b/app/(private)/BitacoraSanciones/page.tsx @@ -2,24 +2,19 @@ import BitacoraAlumno from "@/app/Components/BitacoraSanciones/BitacoraAlumno"; import BitacoraEquipo from "@/app/Components/BitacoraSanciones/BitacoraEquipo"; import BitacoraMesas from "@/app/Components/BitacoraSanciones/BitacoraMesas"; import Sanciones from "@/app/Components/BitacoraSanciones/Sanciones"; +import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; import { GetStudent } from "@/app/lib/getStudent"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; export default async function Page(props: { searchParams?: Promise<{ key?: string; numAcount?: string; - success?: string; - error?: string; }>; }) { const params = await props.searchParams; const key = params?.key && params.key ; const numAcount = params?.numAcount ? params.numAcount : null; - const showSuccess = params?.success ? params.success : null; - const showError = params?.error ? params.error : null; let student: any = null; @@ -34,19 +29,6 @@ export default async function Page(props: { return (
- {showError && ( - <> - - - - )} - - {showSuccess && ( - <> - - - - )}

BITACORA Y SANCIONES

@@ -67,6 +49,7 @@ export default async function Page(props: { label: "Bitacora alumno", content: ( <> + ), diff --git a/app/(private)/CambiarPass/page.tsx b/app/(private)/CambiarPass/page.tsx index 23da32e..c6388ad 100644 --- a/app/(private)/CambiarPass/page.tsx +++ b/app/(private)/CambiarPass/page.tsx @@ -1,32 +1,13 @@ import ChangePassword from "@/app/Components/auth/ChangePassword/changePassword"; -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; export default async function Page(props: { searchParams?: Promise<{ - success?: string; - error?: string; }>; }) { const params = await props.searchParams; - const showSuccess = params?.success ? params.success : null; - const showError = params?.error ? params.error : null; return (
- {showError && ( - <> - - - - )} - - {showSuccess && ( - <> - - - - )}

Cambiar contraseña

diff --git a/app/(private)/Impresiones/page.tsx b/app/(private)/Impresiones/page.tsx index f78b77e..ca95c16 100644 --- a/app/(private)/Impresiones/page.tsx +++ b/app/(private)/Impresiones/page.tsx @@ -2,53 +2,40 @@ import SearchUser from "../../Components/Global/SearchUser/searchUser"; import Receipt from "../../Components/Receipt/Receipt"; import Toggle from "../../Components/Global/Toggle/Toggle"; import Information from "../../Components/Global/Information/information"; -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; import Impressions from "@/app/Components/Impressions/impressions"; +import ShowError from "@/app/Components/Global/ShowError"; + import { GetStudent } from "@/app/lib/getStudent"; import "@/app/globals.css"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; export default async function Page(props: { searchParams?: Promise<{ key: string; numAcount: string; - success?: string; - error?: string; }>; }) { const params = await props.searchParams; const key = params?.key && params.key; const numAcount = params?.numAcount ? params.numAcount : null; - const showSuccess = params?.success ? params.success : null; - const showError = params?.error ? params.error : null; let student: any = null; + let errorMessage = ""; if (numAcount) { const result = await GetStudent(parseInt(numAcount)); if (result.error) { + errorMessage = `${result.error}`; } else { - student = result; + student = result as Student; } } return (
- {showError && ( - <> - - - - )} - {showSuccess && ( - <> - - - - )} + {errorMessage && }

IMPRESIONES Y PLOTEO

diff --git a/app/(private)/InformacionEquipo/page.tsx b/app/(private)/InformacionEquipo/page.tsx index 822caa7..9645f0e 100644 --- a/app/(private)/InformacionEquipo/page.tsx +++ b/app/(private)/InformacionEquipo/page.tsx @@ -1,40 +1,21 @@ import Toggle from "@/app/Components/Global/Toggle/Toggle"; import Equipos from "@/app/Components/Equipos/equipos"; -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; import ProgramSelector from "@/app/Components/InformacionEquipos/ProgramSelector"; import "./informacionequipo.css"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; export default async function Page(props: { searchParams?: Promise<{ key?: string; machine?: string; - success?: string; - error?: string; }>; }) { const params = await props.searchParams; const key = params?.key && params.key; const machine = params?.machine ? params.machine : null; - const showSuccess = params?.success ? params.success : null; - const showError = params?.error ? params.error : null; return (
- {showError && ( - <> - - - - )} - - {showSuccess && ( - <> - - - - )}

INFORMACION DE EQUIPOS

diff --git a/app/(private)/Inscripcion/inscripcion.css b/app/(private)/Inscripcion/inscripcion.css index 7b05ca4..c448ebb 100644 --- a/app/(private)/Inscripcion/inscripcion.css +++ b/app/(private)/Inscripcion/inscripcion.css @@ -1,9 +1,37 @@ -.inscripcion{ - background-color: #f9f9f9; - width: 100%; - max-width: 700px; - border-radius: 4px; - padding: 1rem; - margin-top: 1rem; - outline: 1px solid #cfcfcf; -} \ No newline at end of file +.inscripcion { + position: relative; + top: 0; + background-color: #ffffff; + width: 100%; + max-width: 700px; + border-radius: 4px; + padding: 1rem; + margin-top: 1rem; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); +} + +.containeInformation { + display: flex; + gap: 10px; + width: 100%; +} + +.firstPartInformation { + display: flex; + flex-direction: column; + width: 100%; + max-width: 450px; +} + +@media (max-width: 800px) { + .containeInformation { + justify-content: center; + align-items: center; + } +} + +@media (max-width: 800px) { + .containeInformation { + flex-direction: column; + } +} diff --git a/app/(private)/Inscripcion/page.tsx b/app/(private)/Inscripcion/page.tsx index b5fd570..6dc0f1c 100644 --- a/app/(private)/Inscripcion/page.tsx +++ b/app/(private)/Inscripcion/page.tsx @@ -2,65 +2,90 @@ import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; import Information from "@/app/Components/Global/Information/information"; import Receipt from "@/app/Components/Receipt/Receipt"; import Selection from "@/app/Components/Selection/Selection"; -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; +import ShowError from "@/app/Components/Global/ShowError"; import { GetStudent } from "@/app/lib/getStudent"; import "./inscripcion.css"; +import Table from "@/app/Components/Global/table"; export default async function Page(props: { searchParams?: Promise<{ numAcount: string; - success?: string; - error?: string; }>; }) { const params = await props.searchParams; const numAcount = params?.numAcount ? params.numAcount : null; - const showSuccess = params?.success ? params.success : null; - let showError = params?.error ? params.error : null; let student: any = null; + let errorMessage = ""; if (numAcount) { const result = await GetStudent(parseInt(numAcount)); if (result.error) { - showError = "Alumno no encontrado"; + errorMessage = `${result.error}`; } else { student = result; } } + const headers = ["Inscrito", "Tiempo", "Confirmó"]; + const data = [ + { + Inscrito: "WINDOWS", + Tiempo: "9 minutos", + Confirmó: "si", + }, + { + Inscrito: "WINDOWS", + Tiempo: "9 minutos", + Confirmó: "si/no", + }, + { + Inscrito: "WINDOWS", + Tiempo: "9 minutos", + Confirmó: "si/no", + }, + ]; + return (
- {showError && ( - <> - - - - )} + {errorMessage && } - {showSuccess && ( - <> - - - - )} +

INSCRIPCIÓN

-

INSCRIPCION

+
+
+ - + {student && ( + + )} +
+ + {student && } + {student && ( <> -
+ + +
diff --git a/app/(private)/Inscritos/page.tsx b/app/(private)/Inscritos/page.tsx index be351f6..33e0605 100644 --- a/app/(private)/Inscritos/page.tsx +++ b/app/(private)/Inscritos/page.tsx @@ -1,33 +1,15 @@ -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; export default async function Page(props: { searchParams?: Promise<{ period: string; - success?: string; - error?: string; }>; }) { const params = await props.searchParams; const period = params?.period ? params.period : null; - const showSuccess = params?.success ? params.success : null; - const showError = params?.error ? params.error : null; return (
- {showError && ( - <> - - - - )} - {showSuccess && ( - <> - - - - )}

INSCRITOS

@@ -53,15 +35,38 @@ export default async function Page(props: {
- - - + +
CarreraWindowsMacintoshLinuxGenero ProfesoresTotal
+ +
+ + + + + + + + + + + + + + + + + + + + +
Impresione B/NImpresiones ColorPlotteoEscanerTotal
5,00010,00010,00020,00045,000
+
); } diff --git a/app/(private)/Mensajes/page.tsx b/app/(private)/Mensajes/page.tsx index eaeaf38..7b9eeba 100644 --- a/app/(private)/Mensajes/page.tsx +++ b/app/(private)/Mensajes/page.tsx @@ -1,35 +1,16 @@ import EnviarMensaje from "@/app/Components/EviarMensaje/EnviarMensaje"; -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; export default async function Page(props: { searchParams?: Promise<{ key:string; - success?: string; - error?: string; }>; }) { const params = await props.searchParams; const key = params?.key && params.key ; - const showSuccess = params?.success ? params.success : null; - const showError = params?.error ? params.error : null; return (
- {showError && ( - <> - - - - )} - - {showSuccess && ( - <> - - - - )}

Enviar mensaje

@@ -41,6 +22,7 @@ export default async function Page(props: { label: "Equipo", content: ( @@ -51,6 +33,7 @@ export default async function Page(props: { label: "Sala", content: ( diff --git a/app/(private)/Monitor/Page.module.css b/app/(private)/Monitor/Page.module.css index 21769a9..7ea84a2 100644 --- a/app/(private)/Monitor/Page.module.css +++ b/app/(private)/Monitor/Page.module.css @@ -1,70 +1,41 @@ .tableContainer { - overflow-y: auto; - overflow-x: auto; - border-radius: 4px; - border: 1px solid #cfcfcf; - max-height: 430px; - scrollbar-color: rgb(1, 92, 184) rgba(0, 0, 0, 0); - background-color: #f9f9f9; - width: 100%; -} - -.machineTable { - width: 100%; - border-collapse: collapse; - table-layout: auto; -} - -.machineTable th, -.machineTable td { - padding: 10px; - text-align: center; - border-bottom: 1px solid #cfcfcf; - word-wrap: break-word; - overflow-wrap: break-word; -} - -.machineTable th { - position: sticky; - top: 0px; - background-color: rgb(1, 92, 184); - color: white; -} - -.machineTable tr { - min-width: 400px; + overflow-y: auto; + overflow-x: auto; + border-radius: 4px; + max-height: 430px; + scrollbar-color: rgb(1, 92, 184) rgba(0, 0, 0, 0); + width: 100%; } .disponible { - display: flex; - width: 100%; - height: 100%; - background-color: green; - color: green; - font-weight: bold; + display: flex; + width: 100%; + height: 100%; + background-color: green; + color: green; + font-weight: bold; } .ocupado { - color: red; - font-weight: bold; + color: red; + font-weight: bold; } - .actions { - text-align: center; + text-align: center; } .resetButton { - padding: 8px 16px; - background-color: #ff4d4d; - color: white; - border: none; - border-radius: 6px; - cursor: pointer; - font-weight: bold; - transition: 0.3s; + padding: 8px 16px; + background-color: #ff4d4d; + color: white; + border: none; + border-radius: 6px; + cursor: pointer; + font-weight: bold; + transition: 0.3s; } .resetButton:hover { - background-color: #cc0000; -} \ No newline at end of file + background-color: #cc0000; +} diff --git a/app/(private)/Monitor/page.tsx b/app/(private)/Monitor/page.tsx index f228ed9..9700015 100644 --- a/app/(private)/Monitor/page.tsx +++ b/app/(private)/Monitor/page.tsx @@ -3,35 +3,56 @@ import styles from "./Page.module.css"; export default async function Page(props: { searchParams?: Promise<{ numAcount: string; - success?: string; - error?: string; }>; }) { const params = await props.searchParams; const numAcount = params?.numAcount ? params.numAcount : null; - const showSuccess = params?.success ? params.success : null; - const showError = params?.error ? params.error : null; return ( -
-

MONITOR DE MÁQUINAS DISPONIBLES

+
+

MONITOR DE MÁQUINAS DISPONIBLES

- +
- + + + + + + + + {/* {machines.map((machine, index) => ( @@ -51,4 +72,4 @@ export default async function Page(props: { ); } -//IO \ No newline at end of file +//IO diff --git a/app/(private)/Programas/page.tsx b/app/(private)/Programas/page.tsx index 014e048..078d3e4 100644 --- a/app/(private)/Programas/page.tsx +++ b/app/(private)/Programas/page.tsx @@ -18,7 +18,7 @@ export default function Page() { }; return ( - <> +
{modo === "ver" && (

PROGRAMAS

@@ -86,6 +86,6 @@ export default function Page() {
)} - +
); } diff --git a/app/(private)/QuitarSancion/page.tsx b/app/(private)/QuitarSancion/page.tsx index 74d7ef3..7e2a7ed 100644 --- a/app/(private)/QuitarSancion/page.tsx +++ b/app/(private)/QuitarSancion/page.tsx @@ -4,22 +4,19 @@ import QuitarSancion from "@/app/Components/QuitarSancion/QuitarSancion"; export default async function Page(props: { searchParams?: Promise<{ numAcount: string; - success?: string; - error?: string; }>; }) { const params = await props.searchParams; const numAcount = params?.numAcount ? params.numAcount : null; - const showSuccess = params?.success ? params.success : null; - const showError = params?.error ? params.error : null; return ( <> -

Quitar Sanciones

-
- - -
+

Quitar Sanciones

+
+ + +
); } diff --git a/app/(private)/Reportes/page.tsx b/app/(private)/Reportes/page.tsx index 7915e91..a328a07 100644 --- a/app/(private)/Reportes/page.tsx +++ b/app/(private)/Reportes/page.tsx @@ -1,94 +1,42 @@ -"use client"; - -import styles from "./Page.module.css"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; import SearchDateBetween from "@/app/Components/SearchDateBetween/SearchDateBetween"; +import PorServicios from "@/app/Components/Reportes/porServicio"; +import PorRecibos from "@/app/Components/Reportes/porRecibo"; -import { useState } from "react"; - -export default function Page() { - const [reportes] = useState([ - { - Servicio: "Plotter", - Total: "$1440.00", - }, - ]); - - const [recibos] = useState([ - { - folio_recibo: "100255", - monto: "40.00", - fecha_recibo: "10/10/2025", - fecha_registro: "10/10/2025 05:32:20 pm", - usuario: "modulo1", - }, - ]); +export default async function Page(props: { + searchParams?: Promise<{ + key: string; + numAcount: string; + }>; +}) { + const params = await props.searchParams; + const key = params?.key && params.key; return (

REPORTES

-
-
Ubicación Nombre Equipo Plataforma Área Disponible
+ + + + + + + + + +
- - - - - - - - - - - {recibos.map((recibo, index) => ( - - - - - - - - ))} - -
Folio ReciboMontoFecha ReciboFecha RegistroUsuario
{recibo.folio_recibo}{recibo.monto}{recibo.fecha_recibo}{recibo.fecha_registro}{recibo.usuario}
-
+ ), }, { - key: "2", + key: "Por Servicio", label: "Por Servicio", content: ( <> -
- - - - - - - - - {reportes.map((reporte, index) => ( - - - - - ))} - -
ServicioTotal
{reporte.Servicio}{reporte.Total}
-
+ ), }, diff --git a/app/Components/ActivosMantenimiento/Areas.tsx b/app/Components/ActivosMantenimiento/Areas.tsx index 16a06e4..e76508f 100644 --- a/app/Components/ActivosMantenimiento/Areas.tsx +++ b/app/Components/ActivosMantenimiento/Areas.tsx @@ -1,13 +1,15 @@ "use client"; import { useState } from "react"; +import "@/app/globals.css" + export default function Areas() { const [area, setArea] = useState(""); // Área seleccionada const [activo, setActivo] = useState(false); // Checkbox Activo const [mantenimiento, setMantenimiento] = useState(false); // Checkbox Mantenimiento const [mensaje, setMensaje] = useState(""); // Mensaje dinámico - const handleActualizar = (e: React.FormEvent) => { + const handleActualizar = (e: React.FormEvent) => { e.preventDefault(); if (!area) { @@ -35,11 +37,10 @@ export default function Areas() { return ( - +
- {/* Select de áreas */} {/* Checkboxes */} +
+
-
+
{/* Botón Actualizar */}
+ ); +} +//IO diff --git a/app/Components/EviarMensaje/EnviarMensaje.tsx b/app/Components/EviarMensaje/EnviarMensaje.tsx index 99aadfb..3a6f637 100644 --- a/app/Components/EviarMensaje/EnviarMensaje.tsx +++ b/app/Components/EviarMensaje/EnviarMensaje.tsx @@ -12,7 +12,7 @@ const EnviarMensaje = ({ titulo, opciones }: EnviarMensajeProps) => { const [mensaje, setMensaje] = useState(""); const [customMsg, setCustomMsg] = useState(""); - const handleSubmit = (e: React.FormEvent) => { + const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); // Aquí puedes manejar el envío (guardar en estado global, enviar a backend, etc.) }; @@ -51,6 +51,7 @@ const EnviarMensaje = ({ titulo, opciones }: EnviarMensajeProps) => { ))} + {/* Mensaje personalizado */} @@ -62,10 +63,12 @@ const EnviarMensaje = ({ titulo, opciones }: EnviarMensajeProps) => { onChange={(e) => setCustomMsg(e.target.value)} placeholder="Escribe tu mensaje..." /> + + {/* Botón de enviar */} - diff --git a/app/Components/Global/AlertBox/AlertBox.css b/app/Components/Global/AlertBox/AlertBox.css deleted file mode 100644 index cceac3f..0000000 --- a/app/Components/Global/AlertBox/AlertBox.css +++ /dev/null @@ -1,57 +0,0 @@ -@keyframes slideInLeft { - 0% { - opacity: 0; - transform: translateX(-100%); - } - 100% { - opacity: 0.9; - transform: translateX(0); - } -} - -@keyframes slideOutRight { - 0% { - opacity: 0.9; - transform: translateX(0); - } - 100% { - opacity: 0; - transform: translateX(100%); - } -} - -.messageBox { - display: flex; - position: absolute; - padding: 0.5rem 1.25rem; - border-radius: 0 4px 4px 0; - font-weight: bold; - font-size: 2rem; - text-align: center; - z-index: 100; - top: 0; - left: 0; - max-width: 500px; - max-height: min-content; - opacity: 0; -} - -.messageBox:not(.hidden) { - animation: slideInLeft 0.5s ease forwards; -} - -.messageBox.hidden { - animation: slideOutRight 0.5s ease forwards; -} - -.success { - background-color: #d1f7c4; - color: #000000; - border: 1px solid #a5d6a7; -} - -.error { - background-color: #ffcdd2; - color: #000000; - border: 1px solid #ef9a9a; -} diff --git a/app/Components/Global/AlertBox/AlertBox.tsx b/app/Components/Global/AlertBox/AlertBox.tsx deleted file mode 100644 index aa295e5..0000000 --- a/app/Components/Global/AlertBox/AlertBox.tsx +++ /dev/null @@ -1,42 +0,0 @@ -"use client"; - -import { useEffect, useState } from "react"; -import "./AlertBox.css"; -import ClearParams from "../ClearParams/ClearParams"; - -interface AlertBoxProps { - message: string | null; - type: "error" | "success"; - duration?: number; -} - -export default function AlertBox({ - message, - type, - duration = 6000, -}: AlertBoxProps) { - const [visible, setVisible] = useState(false); - const [text, setText] = useState(""); - - useEffect(() => { - if (message) { - setText(message); - setVisible(true); - - const timeout = setTimeout(() => { - setVisible(false); - setTimeout(() => setText(""), 500); - }, duration); - - return () => clearTimeout(timeout); - } - }, [message, duration]); - - if (!text) return null; - - return ( -
- {text} -
- ); -} diff --git a/app/Components/Global/ClearParams/ClearParams.tsx b/app/Components/Global/ClearParams/ClearParams.tsx deleted file mode 100644 index 7bf870c..0000000 --- a/app/Components/Global/ClearParams/ClearParams.tsx +++ /dev/null @@ -1,28 +0,0 @@ -"use client"; - -import { useEffect } from "react"; - -interface ClearParamsProps { - paramsToClear: string[]; -} - -export default function ClearParams({ paramsToClear }: ClearParamsProps) { - useEffect(() => { - if (typeof window === "undefined") return; - const url = new URL(window.location.href); - let changed = false; - - paramsToClear.forEach((param) => { - if (url.searchParams.has(param)) { - url.searchParams.delete(param); - changed = true; - } - }); - - if (changed) { - window.history.replaceState({}, "", url.toString()); - } - }, [paramsToClear]); - - return null; -} diff --git a/app/Components/Global/FormHandle.tsx b/app/Components/Global/FormHandle.tsx deleted file mode 100644 index 6f3d3c9..0000000 --- a/app/Components/Global/FormHandle.tsx +++ /dev/null @@ -1,40 +0,0 @@ -"use client"; - -import { ReactNode, useCallback } from "react"; -import { useRouter, usePathname, useSearchParams } from "next/navigation"; - -interface FormHandlerProps { - children: ReactNode; - onSubmit: () => Promise; -} - -export default function FormHandler({ children, onSubmit }: FormHandlerProps) { - const router = useRouter(); - const searchParams = useSearchParams(); - const pathname = usePathname(); - - const updateParams = useCallback( - (updates: Record) => { - const params = new URLSearchParams(searchParams.toString()); - - Object.entries(updates).forEach(([key, value]) => { - if (value === null) params.delete(key); - else params.set(key, value); - }); - - router.push(`${pathname}?${params.toString()}`); - }, - [searchParams, router, pathname] - ); - - const handleSubmit = async (e: React.FormEvent) => { - e.preventDefault(); - try { - await onSubmit(); - } catch (err: any) { - updateParams({ error: String(err) }); - } - }; - - return
{children}
; -} diff --git a/app/Components/Global/Information/information.tsx b/app/Components/Global/Information/information.tsx index 3b1db2c..d1a4f9d 100644 --- a/app/Components/Global/Information/information.tsx +++ b/app/Components/Global/Information/information.tsx @@ -1,25 +1,25 @@ -'use client'; - interface InformationProps { [key: string]: string | number | undefined; } export default function Information(props: InformationProps) { - // Obtenemos las entradas (key + value) y filtramos los que sean undefined - const entries = Object.entries(props).filter(([_, value]) => value !== undefined); + const entries = Object.entries(props).filter( + ([_, value]) => value !== undefined + ); - if (entries.length === 0) return null; // no mostrar nada si no hay datos + if (entries.length === 0) return null; return (
-
    +
      {entries.map(([key, value]) => ( -
    • - {key}: {value} +
    • + {key} + {value}
    • ))}
); } -//IO \ No newline at end of file +//IO diff --git a/app/Components/Global/SearchUser/searchUser.tsx b/app/Components/Global/SearchUser/searchUser.tsx index 8057454..3dc6881 100644 --- a/app/Components/Global/SearchUser/searchUser.tsx +++ b/app/Components/Global/SearchUser/searchUser.tsx @@ -19,11 +19,10 @@ function SearchUser(props: urlProp) { } }, [props.value]); - const handleSubmit = (e: React.FormEvent) => { + const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); const params = new URLSearchParams(searchParams.toString()); if (numAcount) { - params.delete("error"); params.set("numAcount", `${numAcount}`); router.push(`${pathname}?${params.toString()}`); } @@ -57,3 +56,4 @@ function SearchUser(props: urlProp) { } export default SearchUser; +//IO \ No newline at end of file diff --git a/app/Components/Global/ShowError.tsx b/app/Components/Global/ShowError.tsx new file mode 100644 index 0000000..ef7140b --- /dev/null +++ b/app/Components/Global/ShowError.tsx @@ -0,0 +1,14 @@ +"use client"; + +import { useEffect } from "react"; +import toast from "react-hot-toast"; + +export default function ShowError({ message }: { message: string }) { + useEffect(() => { + if (message) { + toast.error(message); + } + }, [message]); + + return null; +} diff --git a/app/Components/Global/StepNavigator/StepNavigator.tsx b/app/Components/Global/StepNavigator/StepNavigator.tsx index a91a7e2..ac25728 100644 --- a/app/Components/Global/StepNavigator/StepNavigator.tsx +++ b/app/Components/Global/StepNavigator/StepNavigator.tsx @@ -1,50 +1,49 @@ -'use client' +"use client"; import { useState, ReactNode } from "react"; -import "./StepNavigator.css" +import "./StepNavigator.css"; interface StepNavigatorProps { - totalSteps: number; - children: ReactNode[]; - onFinish?: () => void; + totalSteps: number; + children: ReactNode[]; + onFinish?: () => void; } -export default function StepNavigator({ totalSteps, children, onFinish }: StepNavigatorProps) { - const [step, setStep] = useState(1); +export default function StepNavigator({ + totalSteps, + children, + onFinish, +}: StepNavigatorProps) { + const [step, setStep] = useState(1); - const handleNext = (e: React.MouseEvent) => { - e.preventDefault(); - if (step < totalSteps) setStep(step + 1); - else if (onFinish) onFinish(); - }; + const handleNext = (e: React.MouseEvent) => { + e.preventDefault(); + if (step < totalSteps) setStep(step + 1); + else if (onFinish) onFinish(); + }; - const handlePrev = (e: React.MouseEvent) => { - e.preventDefault(); - if (step > 1) setStep(step - 1); - }; + const handlePrev = (e: React.MouseEvent) => { + e.preventDefault(); + if (step > 1) setStep(step - 1); + }; - return ( -
- {children[step - 1]} + return ( +
+ {children[step - 1]} -
- {step > 1 && ( - - )} +
+ {step > 1 && ( + + )} - {step < totalSteps && - -} -
-
- ); + {step < totalSteps && ( + + )} + +
+ ); } diff --git a/app/Components/Global/selectArea.tsx b/app/Components/Global/selectArea.tsx new file mode 100644 index 0000000..d17cc3e --- /dev/null +++ b/app/Components/Global/selectArea.tsx @@ -0,0 +1,31 @@ +import apiClient from "@/app/lib/apiClient"; +import { useEffect, useState } from "react"; + +export default function selectArea() { + const [area, setArea] = useState([]); + + useEffect(() => { + const fetchArea = async () => { + const response = await apiClient.get("/area-ubicacion"); + setArea(response.data); + }; + + fetchArea(); + }); + return ( + <> + + + + ); +} diff --git a/app/Components/Global/table.module.css b/app/Components/Global/table.module.css new file mode 100644 index 0000000..b25dd2e --- /dev/null +++ b/app/Components/Global/table.module.css @@ -0,0 +1,8 @@ +.tableContainer { + width: 100%; + max-width: 450px; + overflow-x: hidden; + scrollbar-color: #2563eb #ffffff00; + scroll-behavior: smooth; + transition: all 0.3s ease; +} diff --git a/app/Components/Global/table.tsx b/app/Components/Global/table.tsx new file mode 100644 index 0000000..a44a1b4 --- /dev/null +++ b/app/Components/Global/table.tsx @@ -0,0 +1,40 @@ +"use client"; + +import React from "react"; +import styles from "./table.module.css"; + +interface TableProps { + headers: string[]; + data: Array>; +} + +export default function Table({ headers, data }: TableProps) { + return ( +
+ + + + {headers.map((header, index) => ( + + ))} + + + + {data.length > 0 ? ( + data.map((row, rowIndex) => ( + + {headers.map((header, colIndex) => ( + + ))} + + )) + ) : ( + + + + )} + +
{header}
{row[header]}
No hay registros
+
+ ); +} diff --git a/app/Components/Global/visual/GlobalAlert.tsx b/app/Components/Global/visual/GlobalAlert.tsx deleted file mode 100644 index a1518bf..0000000 --- a/app/Components/Global/visual/GlobalAlert.tsx +++ /dev/null @@ -1,36 +0,0 @@ -"use client"; - -import { useEffect, useState } from "react"; -import AlertBox from "@/app/Components/Global/AlertBox/AlertBox"; -import ClearParams from "@/app/Components/Global/ClearParams/ClearParams"; -import { useSearchParams } from "next/navigation"; - -export default function GlobalAlert() { - const searchParams = useSearchParams(); - const [showSuccess, setShowSuccess] = useState(null); - const [showError, setShowError] = useState(null); - - useEffect(() => { - const success = searchParams.get("success"); - const error = searchParams.get("error"); - - if (success) setShowSuccess(success); - if (error) setShowError(error); - }, []); - - return ( -
- {showError && ( - <> - - - )} - - {showSuccess && ( - <> - - - )} -
- ); -} diff --git a/app/Components/Impressions/impressions.tsx b/app/Components/Impressions/impressions.tsx index 018a35d..6a03ba4 100644 --- a/app/Components/Impressions/impressions.tsx +++ b/app/Components/Impressions/impressions.tsx @@ -4,6 +4,7 @@ import Cookies from "js-cookie"; import { useState } from "react"; import { useRouter } from "next/navigation"; import { PostImpressions } from "@/app/lib/postImpressions"; +import toast from "react-hot-toast"; interface CostOption { value: number; @@ -27,24 +28,19 @@ function Impressions({ costs, numAcount }: ImpressionsProps) { }; const handlePayment = async () => { - const currentUrl = new URL(window.location.href); - const params = new URLSearchParams(); - - const setError = (msg: string) => { - params.set("error", msg); - router.push(`${currentUrl}&${params.toString()}`); - }; - if (!numAcount) { - return setError("busca de nuevo al estudiante"); + toast.error("busca de nuevo al estudiante"); + return; } if (!pages) { - return setError("Ingresa el numero de hojas a imprimir"); + toast.error("Ingresa el numero de hojas a imprimir"); + return; } if (!cost) { - return setError("Selecciona un costo"); + toast.error("Selecciona un costo"); + return; } const result = await PostImpressions({ @@ -56,16 +52,16 @@ function Impressions({ costs, numAcount }: ImpressionsProps) { if (result.error) { if (result.error === "Token inválido") handleLogout(); else { - return setError(`Error: ${result.error}`); + toast.error(result.error); + return; } return; } setPages(""); setCost(""); - params.delete("error"); - params.set("success", "Impresion cobrada correctamente"); - router.push(`${currentUrl}&${params.toString()}`); + toast.success("Impresion cobrada correctamente"); + router.refresh(); }; return ( diff --git a/app/Components/InformacionEquipos/ProgramSelector.tsx b/app/Components/InformacionEquipos/ProgramSelector.tsx index 102381c..3629fd8 100644 --- a/app/Components/InformacionEquipos/ProgramSelector.tsx +++ b/app/Components/InformacionEquipos/ProgramSelector.tsx @@ -1,5 +1,6 @@ "use client"; import { useState } from "react"; +import SelectAreas from "../SelectAreas"; interface DatosEquipo { titulo: string; @@ -43,7 +44,7 @@ const caracteristicasPorEquipo: Record = { // Agrega más equipos según necesites }; -function ProgramSelector({ titulo, opcion }: DatosEquipo) { +export default function ProgramSelector({ titulo, opcion }: DatosEquipo) { // Estado del equipo seleccionado const [equipoSeleccionado, setEquipoSeleccionado] = useState(""); // Estado de los checkboxes (programas) @@ -108,5 +109,3 @@ function ProgramSelector({ titulo, opcion }: DatosEquipo) { ); } - -export default ProgramSelector; diff --git a/app/Components/QuitarSancion/Page.module.css b/app/Components/QuitarSancion/Page.module.css index b8783c6..5cf0020 100644 --- a/app/Components/QuitarSancion/Page.module.css +++ b/app/Components/QuitarSancion/Page.module.css @@ -6,7 +6,6 @@ max-height: 430px; scrollbar-color: rgb(1, 92, 184) rgba(0, 0, 0, 0); background-color: #f9f9f9; - width: 65%; } .machineTable { diff --git a/app/Components/QuitarSancion/QuitarSancion.tsx b/app/Components/QuitarSancion/QuitarSancion.tsx index 4249427..03516d2 100644 --- a/app/Components/QuitarSancion/QuitarSancion.tsx +++ b/app/Components/QuitarSancion/QuitarSancion.tsx @@ -16,15 +16,15 @@ function QuitarSancion() { const [quitarSanciones, SetQuitarSanciones] = useState([]); return (
-
+
- + - + @@ -42,7 +42,7 @@ function QuitarSancion() {
id NombreMotivo SancionMotivo Sanción Duracion (semanas) Fecha SancionFecha Sanción Podria utilizar el servicio hasta
- +
); } diff --git a/app/Components/Receipt/Receipt.css b/app/Components/Receipt/Receipt.css index e69de29..94a4965 100644 --- a/app/Components/Receipt/Receipt.css +++ b/app/Components/Receipt/Receipt.css @@ -0,0 +1,24 @@ +.groupInformation { + display: flex; + max-width: 500px; + min-width: 40px; + width: 100%; + justify-content: end; + gap: 10px; +} + +.informationButton { + text-align: center; + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + border: 1px solid #cfcfcf; + background-color: #fff; + max-width: 40px; + min-width: 40px; +} + +.informationButton:hover { + border: 1px solid #cfcfcf; + background-color: #cfcfcf; +} diff --git a/app/Components/Receipt/Receipt.tsx b/app/Components/Receipt/Receipt.tsx index 60efc9d..4c0891d 100644 --- a/app/Components/Receipt/Receipt.tsx +++ b/app/Components/Receipt/Receipt.tsx @@ -1,5 +1,6 @@ "use client"; +import toast from "react-hot-toast"; import { useState } from "react"; import { PostReceipt } from "@/app/lib/postReceipt"; import { useRouter } from "next/navigation"; @@ -28,28 +29,24 @@ function Receipt({ numAcount }: ReceiptsProps) { //restrict this month// const handleSaveReceipt = async () => { - const currentUrl = new URL(window.location.href); - const params = new URLSearchParams(); - - const setError = (msg: string) => { - params.set("error", msg); - router.push(`${currentUrl}&${params.toString()}`); - }; - if (!numAcount) { - return setError("busca de nuevo al estudiante"); + toast.error("busca de nuevo al estudiante"); + return; } if (!folio) { - return setError("Ingresa el folio del ticket"); + toast.error("Ingresa el folio del ticket"); + return; } if (!amount) { - return setError("Coloca el monto a depositar"); + toast.error("Coloca el monto a depositar"); + return; } if (!date) { - return setError("Coloca la fecha"); + toast.error("Coloca la fecha"); + return; } try { @@ -64,11 +61,10 @@ function Receipt({ numAcount }: ReceiptsProps) { setAmount(""); setDate(""); - params.delete("error"); - params.set("success", "Recibo guardado"); - router.push(`${currentUrl}&${params.toString()}`); + toast.success("Recibo guardado"); + router.refresh(); } catch (err: any) { - setError(String(err)); + toast.error(String(err)); } }; @@ -111,10 +107,7 @@ function Receipt({ numAcount }: ReceiptsProps) { if (value === "" || numericValue <= 1000) { setAmount(value); } else { - const currentUrl = new URL(window.location.href); - const params = new URLSearchParams(); - params.set("error", "El monto no puede superar $1000.00"); - router.push(`${currentUrl}&${params.toString()}`); + toast.error("El monto no puede superar $1000.00"); } } }} diff --git a/app/Components/Reportes/Page.module.css b/app/Components/Reportes/Page.module.css new file mode 100644 index 0000000..d48a3c1 --- /dev/null +++ b/app/Components/Reportes/Page.module.css @@ -0,0 +1,69 @@ +.tableContainer { + overflow-y: auto; + overflow-x: auto; + border-radius: 4px; + border: 1px solid #cfcfcf; + max-height: 430px; + scrollbar-color: rgb(1, 92, 184) rgba(0, 0, 0, 0); + background-color: #f9f9f9; + width: 100%; +} + +.machineTable { + width: 100%; + border-collapse: collapse; + table-layout: auto; +} + +.machineTable th, +.machineTable td { + padding: 10px; + text-align: center; + border-bottom: 1px solid #cfcfcf; + word-wrap: break-word; + overflow-wrap: break-word; +} + +.machineTable th { + position: sticky; + top: 0px; + background-color: rgb(1, 92, 184); + color: white; +} + +.machineTable tr { + min-width: 400px; +} + +.disponible { + display: flex; + width: 100%; + height: 100%; + background-color: green; + color: green; + font-weight: bold; +} + +.ocupado { + color: red; + font-weight: bold; +} + +.actions { + text-align: center; +} + +.resetButton { + padding: 8px 16px; + background-color: #ff4d4d; + color: white; + border: none; + border-radius: 6px; + cursor: pointer; + font-weight: bold; + transition: 0.3s; +} + +.resetButton:hover { + background-color: #cc0000; +} diff --git a/app/Components/Reportes/porRecibo.tsx b/app/Components/Reportes/porRecibo.tsx new file mode 100644 index 0000000..8590296 --- /dev/null +++ b/app/Components/Reportes/porRecibo.tsx @@ -0,0 +1,34 @@ +"use client"; +import { useState } from "react"; +import styles from "./Page.module.css"; + +interface reportes { + Servicio: "Plotter"; + Total: "$1440.00"; +} + +function PorRecibos() { + const [reportes, SetQuitarSanciones] = useState([]); + return ( +
+ + + + + + + + + {reportes.map((reporte, index) => ( + + + + + ))} + +
ServicioTotal
{reporte.Servicio}{reporte.Total}
+
+ ); +} + +export default PorRecibos; diff --git a/app/Components/Reportes/porServicio.tsx b/app/Components/Reportes/porServicio.tsx new file mode 100644 index 0000000..0259344 --- /dev/null +++ b/app/Components/Reportes/porServicio.tsx @@ -0,0 +1,43 @@ +"use client"; +import { useState } from "react"; +import styles from "./Page.module.css"; + +interface servicios { + folio_recibo: "100255"; + monto: "40.00"; + fecha_recibo: "10/10/2025"; + fecha_registro: "10/10/2025 05:32:20 pm"; + usuario: "modulo1"; +} + +function PorServicios() { + const [recibos, setRecibos] = useState([]); + return ( +
+ + + + + + + + + + + + {recibos.map((recibo, index) => ( + + + + + + + + ))} + +
Folio ReciboMontoFecha ReciboFecha RegistroUsuario
{recibo.folio_recibo}{recibo.monto}{recibo.fecha_recibo}{recibo.fecha_registro}{recibo.usuario}
+
+ ); +} + +export default PorServicios; diff --git a/app/Components/SearchDateBetween/SearchDateBetween.tsx b/app/Components/SearchDateBetween/SearchDateBetween.tsx index 2cfb89b..38102bb 100644 --- a/app/Components/SearchDateBetween/SearchDateBetween.tsx +++ b/app/Components/SearchDateBetween/SearchDateBetween.tsx @@ -6,7 +6,7 @@ function SearchDateBetween() { const [startDate, setStartDate] = useState(""); const [endDate, setEndDate] = useState(""); - const handleSubmit = (e: React.FormEvent) => { + const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); console.log("Fecha inicio:", startDate); console.log("Fecha fin:", endDate); diff --git a/app/Components/SearchEquipo.tsx b/app/Components/SearchEquipo.tsx index 926c232..80384a7 100644 --- a/app/Components/SearchEquipo.tsx +++ b/app/Components/SearchEquipo.tsx @@ -1,11 +1,12 @@ "use client"; export default function SearchEquipo() { return ( -
+ - - - +
+ + +
); } diff --git a/app/Components/SearchTable.tsx b/app/Components/SearchTable.tsx index 76e27b8..a22933c 100644 --- a/app/Components/SearchTable.tsx +++ b/app/Components/SearchTable.tsx @@ -1,12 +1,11 @@ export default function SearchTable() { return (
- {" "} - -
- - -
+ +
+ + +
); } diff --git a/app/Components/SelectAreas.tsx b/app/Components/SelectAreas.tsx index 5568397..0dc8ea8 100644 --- a/app/Components/SelectAreas.tsx +++ b/app/Components/SelectAreas.tsx @@ -1,35 +1,35 @@ -"use clien"; -import React, { useEffect, useState } from "react"; +"use client"; +import axios from "axios"; +import { useEffect, useState } from "react"; export default function SelectAreas() { - const [areas, setAreas] = useState([]); // aquí guardaremos los datos del servidor + const [areas, setAreas] = useState([]); const [selectedArea, setSelectedArea] = useState(""); - // useEffect se ejecuta una vez al montar el componente useEffect(() => { - fetch("https://venus.acatlan.unam.mx/asignacionTiempo_test/area-ubicacion") - .then((response) => response.json()) + axios + .get("https://venus.acatlan.unam.mx/asignacionTiempo_test/area-ubicacion") .then((data) => { - console.log("Áreas obtenidas:", data); - setAreas(data); + setAreas(data.data); }) .catch((error) => { console.error("Error al traer las áreas:", error); }); }, []); - const handleChange = (e) => { - setSelectedArea(e.target.value); - console.log("Área seleccionada:", e.target.value); - }; - return (
- setSelectedArea(e.target.value)} + > + + {areas.map((area: any, index) => ( + ))}
diff --git a/app/Components/Selection/Selection.css b/app/Components/Selection/Selection.css index f1f30ce..1c70764 100644 --- a/app/Components/Selection/Selection.css +++ b/app/Components/Selection/Selection.css @@ -3,7 +3,6 @@ gap: 1rem; justify-content: center; align-items: center; - margin: 10px; flex-wrap: wrap; } diff --git a/app/Components/auth/ChangePassword/changePassword.tsx b/app/Components/auth/ChangePassword/changePassword.tsx index c02db53..e59abfc 100644 --- a/app/Components/auth/ChangePassword/changePassword.tsx +++ b/app/Components/auth/ChangePassword/changePassword.tsx @@ -1,4 +1,5 @@ "use client"; +import apiClient from "@/app/lib/apiClient"; import { useState } from "react"; export default function ChangePassword() { @@ -6,10 +7,11 @@ export default function ChangePassword() { const [newPass, setNewPass] = useState(""); const [confirmNewPass, setconfirmNewPass] = useState(""); - const handleChangePass = (e: React.FormEvent) => { + const handleChangePass = async (e: React.FormEvent) => { e.preventDefault; const data = { pass, newPass, confirmNewPass }; - console.log(data); + + await apiClient.post("/user/create", data); }; return ( diff --git a/app/Components/auth/Login/Login.tsx b/app/Components/auth/Login/Login.tsx index e5adf37..4cd7228 100644 --- a/app/Components/auth/Login/Login.tsx +++ b/app/Components/auth/Login/Login.tsx @@ -3,33 +3,41 @@ import { useState } from "react"; import { loginUser } from "@/app/lib/login"; import { useRouter } from "next/navigation"; +import toast from "react-hot-toast"; import "./Login.css"; -import AlertBox from "../../Global/AlertBox/AlertBox"; function Login() { const [user, setUser] = useState(""); const [password, setPassword] = useState(""); - const [error, setError] = useState(""); - const [alert, setAlert] = useState(""); const router = useRouter(); const handleLogin = async (e: React.FormEvent) => { e.preventDefault(); + if (!user) { + toast.error("Coloca un usuario"); + return; + } + + if (!password) { + toast.error("Coloca una contraseña"); + return; + } + const data = await loginUser(user, password); if ("error" in data) { - setError(data.error); + toast.error(data.error); } else { const token = data.access_token; const payload = JSON.parse(atob(token.split(".")[1])); const usuario = payload.usuario; document.cookie = `token=${token}; path=/; SameSite=Strict`; - document.cookie = `usuario=${usuario}; path=/; SameSite=Strict`; + document.cookie = `user=${usuario}; path=/; SameSite=Strict`; - setAlert("Inicio de sesión exitoso"); + toast.success("Inicio de sesión exitoso"); router.push("/Impresiones"); } }; @@ -70,9 +78,6 @@ function Login() { > Iniciar sesión - - {error && } - {alert && }
); diff --git a/app/Components/layout/BarNavigation/BarNavigation.tsx b/app/Components/layout/BarNavigation/BarNavigation.tsx index d8009bb..1b8b2a0 100644 --- a/app/Components/layout/BarNavigation/BarNavigation.tsx +++ b/app/Components/layout/BarNavigation/BarNavigation.tsx @@ -24,7 +24,7 @@ function BarNavigation() {
  • - toggleSubMenu(0)}>Inscripcion + toggleSubMenu(0)}>Inscripción
    • Alta
    • @@ -33,7 +33,7 @@ function BarNavigation() {
    • Agregar Tiempo
    • -
    • Inscripcion
    • +
    • Inscripción
  • @@ -90,7 +90,7 @@ function BarNavigation() {
  • - Quitar sancion + Quitar sanción
  • diff --git a/app/Components/layout/ToastProvider.tsx b/app/Components/layout/ToastProvider.tsx new file mode 100644 index 0000000..af3d64b --- /dev/null +++ b/app/Components/layout/ToastProvider.tsx @@ -0,0 +1,45 @@ +"use client"; + +import { Toaster } from "react-hot-toast"; +import React from "react"; + +export function ToastProvider({ children }: { children: React.ReactNode }) { + return ( + <> + {children} + + + ); +} diff --git a/app/globals.css b/app/globals.css index 136fc4e..d6fa085 100644 --- a/app/globals.css +++ b/app/globals.css @@ -23,7 +23,7 @@ body { display: grid; grid-template-rows: auto 1fr auto; min-height: 100dvh; - width: 100dvw; + width: 100vw; overflow: hidden; } @@ -88,11 +88,12 @@ footer p { .mainContainer { position: relative; display: grid; - grid-template-rows: 40px 1fr; + grid-template-rows: auto 1fr; align-items: center; justify-items: center; height: 100%; width: 100%; + background-color: #f9f9f9; } @keyframes fadeInUp { @@ -172,35 +173,43 @@ select { border: 1px solid #cfcfcf; background-color: #fff; border-radius: 4px; - font-size: 2rem; + font-size: 1.5rem; color: black; - height: 4rem; + height: 3.5rem; } input:focus, select:focus { background-color: #f9f9f9; - outline:none; - box-shadow: 0px 0px 8px 2px rgba(0, 62, 121, 0.5); + outline: none; + box-shadow: 0px 0px 8px 2px rgba(0, 62, 121, 0.5); transition: all 0.2s ease-in-out; } -input[type="checkbox"]{ +select:-webkit-scrollbar { + width: 6px; +} + +option { + font-size: 1.5rem; +} + +input[type="checkbox"] { min-width: 3rem; } label { - font-size: 2rem; + font-size: 1.5rem; font-weight: bold; display: block; } button { - font-size: 2rem; + font-size: 1.5rem; padding: 1rem 1.75rem; border-radius: 4px; cursor: pointer; - height: 4rem; + height: 3.5rem; } .groupInput { @@ -209,6 +218,8 @@ button { gap: 10px; align-items: center; justify-content: space-between; + width: 100%; + max-width: 450px; } .button { @@ -277,26 +288,53 @@ a { .information { display: flex; flex-direction: column; - border: 1px solid #e5e7eb; + background-color: #ffffff; border-radius: 4px; - background-color: #f3f4f6; width: 100%; max-width: 450px; - margin-top: 10px; + margin-top: 1rem; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + overflow: hidden; + transition: box-shadow 0.3s ease, transform 0.3s ease; } -.information ul { - padding: 1rem; +.informationList { + list-style: none; + padding: 0 1rem; + margin: 0; +} + +.informationItem { + display: flex; + justify-content: flex-start; + align-items: center; + padding: 5px 0; + border-bottom: 1px solid #e5e5e5; +} + +.informationItem:last-child { + border-bottom: none; +} + +.informationKey { + font-weight: 600; + text-transform: capitalize; + width: 100px; +} + +.informationValue { + color: #555; + font-size: 1.5rem; } .title { top: 0; left: 0; width: 100%; - font-size: 3rem; + font-size: 2.5rem; font-weight: bold; text-align: start; - color:#bd8c01; + color: #bd8c01; border-bottom: 1px solid #cfcfcf; margin-bottom: 10px; } @@ -323,9 +361,9 @@ form { width: 100%; max-width: 750px; margin-top: 1rem; - border: 1px solid #e5e7eb; border-radius: 4px; - background-color: #f9fafb; + background-color: #fff; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } .toggleGroup { @@ -352,11 +390,11 @@ form { } .toggleButton.active { - font-weight: 700; - background-color: #e5e7eb; + font-weight: 600; + background-color: #ffffff; color: rgb(1, 92, 184); border-radius: 4px 4px 0 0; - border-bottom: 1px solid rgb(1, 92, 184); + border-bottom: none; } p { @@ -365,28 +403,78 @@ p { table { width: 100%; - border-collapse: collapse; + border-collapse: separate; + border-spacing: 0 1rem; table-layout: auto; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 1.5rem; + color: #333; } table th, table td { - padding: 10px; - text-align: center; - border-bottom: 1px solid #cfcfcf; - word-wrap: break-word; - overflow-wrap: break-word; + padding: 0.85rem 1.5rem; } table th { position: sticky; - top: 0px; - background-color: rgb(1, 92, 184); - color: white; + top: 0; + color: #ffffff; + font-weight: 800; + text-transform: uppercase; + letter-spacing: 1px; + text-align: center; + z-index: 2; + border: none; +} + +table td { + text-align: center; + word-wrap: break-word; + overflow-wrap: break-word; + border: none; } table tr { - min-width: 400px; + background-color: rgb(255, 255, 255); + transition: background-color 0.2s ease; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); +} + +thead tr { + background-color: #2563eb; + position: relative; + z-index: 1; +} + +tbody tr { + transition: transform 0.3s ease, opacity 0.3s ease; + opacity: 1; + z-index: 0; +} + +tbody tr.hidden { + transform: translateY(-10px); + opacity: 0; + height: 0; +} + +table tr:nth-child(even) { + background-color: #f9f9f9; +} + +table tr:hover { + background-color: #cfcfcf; +} + +table th:first-child, +table td:first-child { + border-radius: 4px 0 0 4px; +} + +table th:last-child, +table td:last-child { + border-radius: 0 4px 4px 0; } .tableContainer { @@ -461,26 +549,6 @@ table tr { justify-content: center; align-items: center; } - - .img { - width: 100%; - } - - .img::after { - background: linear-gradient(to right, #f9f9f993, rgba(128, 128, 128, 0)); - } - - .img::before { - display: flex; - content: ""; - position: absolute; - inset: 0; - background: linear-gradient(to left, #f9f9f993, rgba(128, 128, 128, 0)); - } - - .title { - text-align: center; - } } @media (max-width: 1300px) { @@ -488,6 +556,11 @@ table tr { width: 100%; max-width: none; } + + .containerSection { + overflow: auto; + scrollbar-width: none; + } } @media (max-width: 800px) { @@ -541,6 +614,7 @@ table tr { .containerSection { align-items: center; + scrollbar-width: none; } .centerGrid { @@ -563,7 +637,6 @@ table tr { } button { - font-size: 1.5rem; padding: 1rem 1.5rem; } @@ -580,6 +653,7 @@ table tr { @media (max-width: 450px) { .title { + text-align: center; max-width: 250px; overflow-wrap: break-word; } diff --git a/app/layout.tsx b/app/layout.tsx index b7a6f45..bb5e5fe 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -5,6 +5,7 @@ import Header from "./Components/layout/Header/Header"; import Footer from "./Components/layout/Footer/Footer"; import "./globals.css"; +import { ToastProvider } from "./Components/layout/ToastProvider"; const poppins = Poppins({ variable: "--font-poppins", @@ -27,9 +28,11 @@ export default function RootLayout({ return ( -
    -
    {children}
    -