[FE] Fix error in register sidebar that shows only 'Matpel 2' regardless og the course

master
Araozu 2023-09-20 11:34:03 -05:00
parent 999266b99e
commit 6bd0acc03e
1 changed files with 4 additions and 1 deletions

View File

@ -1,4 +1,5 @@
import { Register } from "../../types/Register";
import { courseMap } from "../../utils/allCourses";
import { formatDate } from "../../utils/functions";
export function RegisterSidebar(props: {register: Register, close: () => void, onDelete: () => void}) {
@ -14,6 +15,8 @@ export function RegisterSidebar(props: {register: Register, close: () => void, o
}
};
const courseName = () => courseMap()[props.register.register_course_id]?.course_name ?? "<curso no encontrado>";
return (
<div class="absolute top-0 bg-c-surface-variant right-0
py-4 px-6 w-[20rem]
@ -22,7 +25,7 @@ export function RegisterSidebar(props: {register: Register, close: () => void, o
<p class="text-xl mb-8">Detalles del certificado</p>
<p class="underline text-lg">Curso</p>
<p class="mb-4">Matpel 2</p>
<p class="mb-4">{courseName()}</p>
<p class="underline text-lg">Código del certificado</p>
<p class="mb-4">{props.register.register_code}</p>