add types

This commit is contained in:
IO420
2025-10-02 01:41:41 -06:00
parent d65efc56ab
commit 08401ce82a
4 changed files with 14 additions and 6 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ export default async function Page(props: {
if (result.error) {
errorMessage = `${result.error}`;
} else {
student = result;
student = result as Student;
}
}
@@ -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 (
<div className="information">
@@ -21,5 +18,5 @@ export default function Information(props: InformationProps) {
</ul>
</div>
);
}
}
//IO
@@ -56,3 +56,4 @@ function SearchUser(props: urlProp) {
}
export default SearchUser;
//IO
+10
View File
@@ -0,0 +1,10 @@
interface Carrera {
carrera: string;
}
interface Student {
id_cuenta: number;
nombre: string;
carrera: Carrera;
credito: number;
}