feat: simplify materials library and use real metadata
This commit is contained in:
@@ -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
Reference in New Issue
Block a user