'use client'; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faCopy, faCheck } from "@fortawesome/free-solid-svg-icons"; import { useState } from "react"; import styles from '@/assets/styles/cid.module.css' interface IIpfsCidProps { label?: string; cid: string; } export function IpfsCid({ label, cid }: IIpfsCidProps) { const [isCopied, setIsCopied] = useState(false); return (
{label}
{cid}
{(isCopied) ? : { navigator.clipboard.writeText(cid) setIsCopied(true) setTimeout(() => setIsCopied(false), 3000) }} > }
) }