Add labeled file materials with format badge
- Store human-readable label in LessonFile.name via optional label field on upload - Add PATCH endpoint to rename existing files inline - Admin: label input before upload, click-to-edit inline rename - Student: colored format badge (PDF/DOCX/XLSX/ZIP/etc) replaces paperclip emoji Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import { LessonContent } from "@/components/student/lesson-content";
|
||||
import { LessonCompleteButton } from "@/components/student/lesson-complete-button";
|
||||
import { HomeworkSection } from "@/components/student/homework-section";
|
||||
import { LessonComments } from "@/components/student/lesson-comments";
|
||||
import { FileFormatBadge } from "@/components/shared/file-format-badge";
|
||||
|
||||
interface Props {
|
||||
params: Promise<{ slug: string; lessonId: string }>;
|
||||
@@ -123,7 +124,7 @@ export default async function LessonPage({ params }: Props) {
|
||||
className="flex items-center gap-3 px-4 py-3 text-sm transition-colors hover:[border-color:var(--foreground)]"
|
||||
style={{ border: "2px solid var(--border)" }}
|
||||
>
|
||||
<span className="text-lg">📎</span>
|
||||
<FileFormatBadge url={file.url} />
|
||||
<span className="flex-1 font-medium">{file.name}</span>
|
||||
<span className="text-xs" style={{ color: "var(--muted-foreground)" }}>
|
||||
{formatSize(file.size)}
|
||||
|
||||
Reference in New Issue
Block a user