fix: 修复图片创作删除与垃圾桶预览
This commit is contained in:
@@ -3,7 +3,7 @@ import type { CSSProperties } from "react";
|
||||
import { api } from "../api";
|
||||
import { ConfirmModal } from "../components/overlays";
|
||||
import type { NavigateFn } from "./route-config";
|
||||
import type { Asset, FreeVideoTask, ImageConversation, ImageExceptionBatchTrash, ModelEntity, Product, Project } from "../types";
|
||||
import type { Asset, FreeVideoTask, ImageConversationTrash, ImageExceptionBatchTrash, ModelEntity, Product, Project } from "../types";
|
||||
import "../trash-page.css";
|
||||
|
||||
type TrashKind = "product" | "asset" | "model" | "image" | "imageExceptionBatch" | "freeVideo" | "project";
|
||||
@@ -73,12 +73,13 @@ const rowsFromModels = (items: ModelEntity[]): TrashRow[] =>
|
||||
cover: m.portrait || m.triview || ""
|
||||
}));
|
||||
|
||||
const rowsFromConversations = (items: ImageConversation[]): TrashRow[] =>
|
||||
const rowsFromConversations = (items: ImageConversationTrash[]): TrashRow[] =>
|
||||
items.map((c) => ({
|
||||
id: c.id,
|
||||
kind: "image",
|
||||
title: c.title || "未命名图片创作",
|
||||
subtitle: `${c.task_count || 0} 个生成任务${dateOf(c.updated_at) ? ` · 删除于 ${dateOf(c.updated_at)}` : ""}`
|
||||
subtitle: `${c.task_count || 0} 个生成任务${dateOf(c.updated_at) ? ` · 删除于 ${dateOf(c.updated_at)}` : ""}`,
|
||||
cover: c.cover_preview_url || ""
|
||||
}));
|
||||
|
||||
const IMAGE_MODE_LABEL: Record<ImageExceptionBatchTrash["mode"], string> = {
|
||||
|
||||
Reference in New Issue
Block a user