fix(web-task): localize task status labels

This commit is contained in:
2026-04-06 00:26:33 +08:00
parent a2d1840e47
commit 8dff555db4
+16 -1
View File
@@ -66,6 +66,20 @@ const STATUS_OPTIONS: Array<{ value: LocalTaskStatus; label: string }> = [
{ value: "ARCHIVED", label: "已归档" }
];
const PRIORITY_LABEL_MAP: Record<LocalTaskPriority, string> = {
LOW: "低",
MEDIUM: "中",
HIGH: "高",
URGENT: "紧急"
};
const STATUS_LABEL_MAP: Record<LocalTaskStatus, string> = {
TODO: "待办",
IN_PROGRESS: "进行中",
DONE: "已完成",
ARCHIVED: "已归档"
};
function toDatetimeLocalValue(timestamp: number | null): string {
if (timestamp === null) {
return "";
@@ -457,7 +471,8 @@ export function TodoShellPage({ session }: TodoShellPageProps) {
>
<p className="truncate text-sm font-medium text-foreground">{task.title}</p>
<p className="mt-1 text-xs text-muted-foreground">
{task.status} · {task.priority} · {formatUpdatedAt(task.updatedAt)}
{STATUS_LABEL_MAP[task.status]} · {PRIORITY_LABEL_MAP[task.priority]} · {" "}
{formatUpdatedAt(task.updatedAt)}
</p>
</button>
);