refactor: sync clonePersistence types, extract WatermarkToolPage
This commit is contained in:
@@ -2,16 +2,10 @@ import { DeleteOutlined, MenuFoldOutlined, MenuUnfoldOutlined, ReloadOutlined }
|
||||
import type { MouseEvent as ReactMouseEvent } from "react";
|
||||
import type { EcommerceHistoryRecord } from "../utils/clonePersistence";
|
||||
|
||||
// 页面内的 EcommerceHistoryRecord 比 clonePersistence 版本更丰富(多了 status/errorMessage/turns),
|
||||
// 这里用 intersection 补齐侧栏实际用到的字段,避免依赖页面的内部类型。
|
||||
type HistoryRecord = EcommerceHistoryRecord & {
|
||||
status?: "generating" | "done" | "failed";
|
||||
};
|
||||
|
||||
interface CommandHistorySidebarProps {
|
||||
collapsed: boolean;
|
||||
showBackdrop: boolean;
|
||||
records: HistoryRecord[];
|
||||
records: EcommerceHistoryRecord[];
|
||||
activeRecordId: string | null;
|
||||
isRefreshing: boolean;
|
||||
refreshMessage: string | null;
|
||||
@@ -23,7 +17,7 @@ interface CommandHistorySidebarProps {
|
||||
onCollapse: () => void;
|
||||
onNewConversation: () => void;
|
||||
onRefresh: () => void;
|
||||
onOpenRecord: (record: HistoryRecord) => void;
|
||||
onOpenRecord: (record: EcommerceHistoryRecord) => void;
|
||||
onDeleteRecord: (recordId: string, event: ReactMouseEvent) => void;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user