fix: update unit display logic and adjust background color in App component

This commit is contained in:
2025-08-27 10:51:59 -06:00
parent 7d5db6bb2f
commit a5542f12ee
2 changed files with 4 additions and 13 deletions

View File

@@ -247,7 +247,7 @@ function Page() {
const t = (u.temas || []).find(([k]: any[]) => String(k).toLowerCase() === "titulo")?.[1]
if (typeof t === "string" && t.trim()) return t
return /^\s*\d+/.test(String(u.key))
? (u.title && u.title !== u.key ? u.title : `Unidad ${u.key ? u.key : 1}`)
? (u.title && u.title !== u.key ? u.title : `Unidad ${u.key && Number(u.key) ? Number(u.key) + 1 : 1}`)
: (u.title || String(u.key))
}
const temasOf = (u: any): string[] => {
@@ -285,7 +285,7 @@ function Page() {
<div className="flex items-center justify-between w-full">
<span className="font-medium">
{/^\s*\d+/.test(String(u.key))
? `Unidad ${u.key ? u.key : 1}${u.__title ? `: ${u.__title}` : ""}`
? `Unidad ${u.key && Number(u.key) ? Number(u.key) + 1 : 1}${u.__title ? `: ${u.__title}` : ""}`
: u.__title}
</span>
<span className="text-[11px] text-neutral-500">{u.__temas.length} tema(s)</span>