fix: 修正 markdown-to-jsx 导入方式 + 新增 formatDateLabel 日期工具函数
- TextPart: default import → named import - MaterialCard: 使用 formatDateLabel 显示今天/昨天/日期 - 清理旧测试文件,新增 ResourceTable 测试
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Typography } from "antd";
|
||||
import Markdown from "markdown-to-jsx/react";
|
||||
import { Markdown } from "markdown-to-jsx/react";
|
||||
|
||||
import type { PartProps } from "./types";
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@ import { Button, Flex, Popconfirm, Tag, Typography } from "antd";
|
||||
|
||||
import type { Material, MaterialStatus } from "../types";
|
||||
|
||||
import { formatDateLabel } from "../../../shared/utils/time";
|
||||
|
||||
interface MaterialCardProps {
|
||||
material: Material;
|
||||
onDelete: () => void;
|
||||
@@ -12,7 +14,7 @@ interface MaterialCardProps {
|
||||
|
||||
function formatAssociatedDate(date: string): string {
|
||||
if (!date) return "—";
|
||||
return date;
|
||||
return formatDateLabel(date);
|
||||
}
|
||||
|
||||
const STATUS_MAP: Record<MaterialStatus, { color: string; label: string }> = {
|
||||
|
||||
Reference in New Issue
Block a user