feat: simplify materials library and use real metadata
All checks were successful
CI / Validate frontend and API (push) Successful in 34s
CI / Build and publish Docker images (push) Successful in 21s

This commit is contained in:
Cauê Faleiros
2026-09-08 15:22:45 -03:00
parent 54f598cd99
commit 10c3d03d9c
6 changed files with 113 additions and 942 deletions

View File

@@ -395,13 +395,23 @@ const CourseModal: React.FC<{
alert("Informe o nome do arquivo para download.");
return;
}
if (!newAttUrl.trim()) {
alert('Informe a URL do material.');
return;
}
try {
new URL(newAttUrl.trim());
} catch {
alert('Informe uma URL válida para o material.');
return;
}
const att: Attachment = {
id: `att-${Date.now()}`,
name: newAttName.trim(),
type: newAttType,
url: newAttUrl.trim() || '#',
size: newAttSize.trim() || '1.5 MB',
url: newAttUrl.trim(),
size: newAttSize.trim() || undefined,
description: newAttDesc.trim()
};
@@ -679,12 +689,21 @@ const CourseModal: React.FC<{
</select>
</div>
<div className="flex gap-2">
<input
type="url"
value={newAttUrl}
onChange={(e) => setNewAttUrl(e.target.value)}
placeholder="URL do material (https://...)"
className="min-w-0 flex-1 bg-white/5 border border-white/10 rounded-lg px-2.5 py-1.5 text-xs text-white focus:outline-none"
/>
</div>
<div className="flex gap-2">
<input
type="text"
value={newAttSize}
onChange={(e) => setNewAttSize(e.target.value)}
placeholder="Ex.: 2,4 MB"
placeholder="Tamanho (opcional)"
className="w-28 bg-white/5 border border-white/10 rounded-lg px-2.5 py-1.5 text-xs text-white focus:outline-none"
/>
<input

File diff suppressed because it is too large Load Diff