fix: use clipboard copy helper library

This commit is contained in:
HouYunFei
2026-05-20 13:29:12 +08:00
parent c20faa665b
commit fd533dd261
8 changed files with 16 additions and 5 deletions
+2 -1
View File
@@ -3,6 +3,7 @@
import { Copy, Download, PencilLine, Search, Trash2, Upload } from "lucide-react";
import { useEffect, useMemo, useRef, useState } from "react";
import { App, Button, Card, Drawer, Empty, Form, Image, Input, Modal, Pagination, Select, Space, Tag, Typography } from "antd";
import copy from "copy-to-clipboard";
import { formatBytes, readFileAsDataUrl } from "@/lib/image-utils";
import { uploadImage } from "@/services/image-storage";
@@ -139,7 +140,7 @@ export default function AssetsPage() {
const copyText = async (asset: Asset) => {
if (asset.kind !== "text") return;
await navigator.clipboard.writeText(asset.data.content);
copy(asset.data.content);
message.success("文本已复制");
};