fix: patch P0 security vulnerabilities and critical UX issues across 6 modules
Security: Add admin/layout.tsx auth guard; Add requirePermission() to 12 admin pages Dashboard: Fix StudentStatsGrid rendering; Fix teacher greeting; Add loading/error boundaries; Fix col-span; Add metadata Announcements: Fix audience filtering; Add user detail page; Trigger notifications on publish; Pass classes data; Add loading.tsx Messages: Implement soft delete; Add unread badge with polling; Add notification dropdown polling; Add keyword search; Add quiet hours DND Management: Add loading/error for 9 admin routes; Fix admin-classes-view to use Select for school/grade Profile/Settings: Add loading/error; Fix parent role routing; Create ParentSettingsView; Integrate AiProviderSettingsCard; Add Tab URL persistence; Add logout confirm; Add avatar; Fix Progress arbitrary class Schema: Add senderDeletedAt/receiverDeletedAt to messages; Add quietHours to notificationPreferences; Add uniqueIndex import Docs: Update architecture docs 004/005
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
"use client"
|
||||
|
||||
import { formatLongDate } from "@/shared/lib/utils"
|
||||
import { TeacherQuickActions } from "./teacher-quick-actions"
|
||||
|
||||
interface TeacherDashboardHeaderProps {
|
||||
@@ -5,18 +8,18 @@ interface TeacherDashboardHeaderProps {
|
||||
}
|
||||
|
||||
export function TeacherDashboardHeader({ teacherName }: TeacherDashboardHeaderProps) {
|
||||
const today = new Date().toLocaleDateString("en-US", {
|
||||
weekday: "long",
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
})
|
||||
const today = formatLongDate(new Date())
|
||||
const hour = new Date().getHours()
|
||||
let greeting = "欢迎回来"
|
||||
if (hour < 12) greeting = "早上好"
|
||||
else if (hour < 18) greeting = "下午好"
|
||||
else greeting = "晚上好"
|
||||
|
||||
return (
|
||||
<div className="flex flex-col justify-between space-y-4 md:flex-row md:items-center md:space-y-0">
|
||||
<div>
|
||||
<h2 className="text-2xl font-bold tracking-tight">Good morning, {teacherName}</h2>
|
||||
<p className="text-muted-foreground">It's {today}. Here's your daily overview.</p>
|
||||
<h2 className="text-2xl font-bold tracking-tight">{greeting},{teacherName}</h2>
|
||||
<p className="text-muted-foreground">今天是 {today},以下是今日概览。</p>
|
||||
</div>
|
||||
<TeacherQuickActions />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user