fix(teacher): 统一详情页返回路径与中英文文案 (P1-3+P2-1)

P1-3: empty-state 默认按钮 variant 改为 outline 并新增 variant prop;button.tsx 导出 ButtonProps;统一 5 个详情页返回路径为 ghost+ArrowLeft+文字标签;course-plan-detail raw a 改为 Link。P2-1: formatLongDate 默认 locale 改为 zh-CN,weekday 改为 short;返回按钮文案中文化;course-plan-detail 全量中文化;grades/analytics 标题中文化。验证:tsc 0 错误,lint 0 错误,架构图 004/005 已同步。
This commit is contained in:
SpecialX
2026-06-22 13:52:26 +08:00
parent c45b3488c5
commit 5ff7ab9e72
10 changed files with 152 additions and 112 deletions

View File

@@ -2,6 +2,7 @@ import * as React from "react"
import Link from "next/link"
import { cn } from "@/shared/lib/utils"
import { Button } from "@/shared/components/ui/button"
import type { ButtonProps } from "@/shared/components/ui/button"
interface EmptyStateProps extends React.HTMLAttributes<HTMLDivElement> {
title: string
@@ -11,6 +12,8 @@ interface EmptyStateProps extends React.HTMLAttributes<HTMLDivElement> {
label: string
onClick?: () => void
href?: string
/** 按钮样式,默认 "outline"(次级按钮)。首次引导场景可用 "default"(主按钮) */
variant?: ButtonProps["variant"]
}
}
@@ -44,11 +47,11 @@ export function EmptyState({
)}
{action && (
action.href ? (
<Button asChild variant="default">
<Button asChild variant={action.variant ?? "outline"}>
<Link href={action.href}>{action.label}</Link>
</Button>
) : (
<Button onClick={action.onClick} variant="default">
<Button onClick={action.onClick} variant={action.variant ?? "outline"}>
{action.label}
</Button>
)