From 08401ce82a8db8825762c940c9bed81880ca9479 Mon Sep 17 00:00:00 2001 From: IO420 Date: Thu, 2 Oct 2025 01:41:41 -0600 Subject: [PATCH] add types --- app/(private)/Impresiones/page.tsx | 2 +- app/Components/Global/Information/information.tsx | 7 ++----- app/Components/Global/SearchUser/searchUser.tsx | 1 + app/types/student.ts | 10 ++++++++++ 4 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 app/types/student.ts diff --git a/app/(private)/Impresiones/page.tsx b/app/(private)/Impresiones/page.tsx index 53494b1..ca95c16 100644 --- a/app/(private)/Impresiones/page.tsx +++ b/app/(private)/Impresiones/page.tsx @@ -28,7 +28,7 @@ export default async function Page(props: { if (result.error) { errorMessage = `${result.error}`; } else { - student = result; + student = result as Student; } } diff --git a/app/Components/Global/Information/information.tsx b/app/Components/Global/Information/information.tsx index 3b1db2c..60c23c8 100644 --- a/app/Components/Global/Information/information.tsx +++ b/app/Components/Global/Information/information.tsx @@ -1,14 +1,11 @@ -'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); - if (entries.length === 0) return null; // no mostrar nada si no hay datos + if (entries.length === 0) return null; return (
@@ -21,5 +18,5 @@ export default function Information(props: InformationProps) {
); -} +} //IO \ No newline at end of file diff --git a/app/Components/Global/SearchUser/searchUser.tsx b/app/Components/Global/SearchUser/searchUser.tsx index 9251b8e..3dc6881 100644 --- a/app/Components/Global/SearchUser/searchUser.tsx +++ b/app/Components/Global/SearchUser/searchUser.tsx @@ -56,3 +56,4 @@ function SearchUser(props: urlProp) { } export default SearchUser; +//IO \ No newline at end of file diff --git a/app/types/student.ts b/app/types/student.ts new file mode 100644 index 0000000..9a5d9de --- /dev/null +++ b/app/types/student.ts @@ -0,0 +1,10 @@ +interface Carrera { + carrera: string; +} + +interface Student { + id_cuenta: number; + nombre: string; + carrera: Carrera; + credito: number; +} \ No newline at end of file