diff --git a/apps/admin/src/features/template-management/TemplateManagementPage.tsx b/apps/admin/src/features/template-management/TemplateManagementPage.tsx index 7025b6b..a0618da 100644 --- a/apps/admin/src/features/template-management/TemplateManagementPage.tsx +++ b/apps/admin/src/features/template-management/TemplateManagementPage.tsx @@ -1,13 +1,14 @@ import { useRef, useState } from "react"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { Alert, Button, List, Modal, Table, Tag, Typography, message } from "antd"; -import { ReloadOutlined, UploadOutlined } from "@ant-design/icons"; +import { EyeOutlined, ReloadOutlined, UploadOutlined } from "@ant-design/icons"; import type { TemplatePackageVersion } from "@personal-brand/api-client"; import { createApiClient } from "../../lib/api.js"; import { AdminPageHeader } from "../../components/AdminPageHeader.js"; import { AdminSection } from "../../components/AdminSection.js"; import { EmptyState } from "../../components/EmptyState.js"; import { ErrorNote, QueryState } from "../../components/QueryState.js"; +import { TemplatePackagePreviewModal } from "./TemplatePackagePreviewModal.js"; const client = createApiClient(); @@ -23,6 +24,7 @@ export function TemplateManagementPage() { const [page, setPage] = useState(1); const [pageSize, setPageSize] = useState(20); const [auditId, setAuditId] = useState(null); + const [previewVersion, setPreviewVersion] = useState(null); const queryClient = useQueryClient(); const packages = useQuery({ queryKey: ["admin-template-packages", page, pageSize], @@ -167,7 +169,7 @@ export function TemplateManagementPage() { key: "report", render: (_, item) => { const report = item.validationReport; - return `${String(report.fileCount ?? "-")} 个,${formatBytes(report.extractedBytes)}`; + return `${typeof report.fileCount === "number" ? report.fileCount : "-"} 个,${formatBytes(report.extractedBytes)}`; }, }, { @@ -188,6 +190,14 @@ export function TemplateManagementPage() { key: "actions", render: (_, item) => ( +