diff --git a/src/components/Files/FileCell.tsx b/src/components/Files/FileCell.tsx index de06a5f..d45d0b9 100644 --- a/src/components/Files/FileCell.tsx +++ b/src/components/Files/FileCell.tsx @@ -1,35 +1,48 @@ import { ButtonIcon, Cell, + Toast, WebFileIcon, } from "@codex-storage/marketplace-ui-components"; import { CodexDataContent } from "@codex-storage/sdk-js"; import { Copy } from "lucide-react"; +import { useState } from "react"; type Props = { content: CodexDataContent; }; export function FileCell({ content }: Props) { - const onCopy = (cid: string) => navigator.clipboard.writeText(cid); + const [toast, setToast] = useState({ time: 0, message: "" }); + + const onCopy = (cid: string) => { + navigator.clipboard.writeText(cid); + setToast({ message: "CID copied to the clipboard.", time: Date.now() }); + }; return ( - -
- + <> + +
+ -
- {content.manifest.filename}
- {content.cid} - onCopy(content.cid)} - animation="buzz" - Icon={(props) => }> + {content.manifest.filename} +
+ {content.cid} + onCopy(content.cid)} + animation="buzz" + Icon={(props) => ( + + )}> +
-
-
+ + + + ); }